[asterisk-bugs] [JIRA] (ASTERISK-20851) Asterisk user/group flags ignored by daemon function in /etc/rc.d/init.d/functions

Sverre G (JIRA) noreply at issues.asterisk.org
Wed Jan 2 17:38:45 CST 2013


    [ https://issues.asterisk.org/jira/browse/ASTERISK-20851?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=201050#comment-201050 ] 

Sverre G commented on ASTERISK-20851:
-------------------------------------

Further info: Commenting out COLOR=yes in /etc/sysconfig/asterisk works around the problem, most likely because the syntax passed to the daemon function in /etc/rc.d/init.d/functions are different. Note that when color is NOT used, there's no additional sh -c when it's called.

	if [ "x$COLOR" = "xyes" ]; then
		export TERM=linux
		daemon sh -c "$DAEMON $ASTARGS -c" >/dev/null </dev/null 2>&1 &
	else
		daemon $DAEMON $ASTARGS
	fi
                
> Asterisk user/group flags ignored by daemon function in /etc/rc.d/init.d/functions
> ----------------------------------------------------------------------------------
>
>                 Key: ASTERISK-20851
>                 URL: https://issues.asterisk.org/jira/browse/ASTERISK-20851
>             Project: Asterisk
>          Issue Type: Bug
>      Security Level: None
>          Components: General
>    Affects Versions: 10.8.0-digiumphones
>         Environment: CentOS release 6.3
>            Reporter: Sverre G
>
> Starting asterisk using:
> $ /usr/sbin/safe_asterisk -U asterisk -G asterisk -c
> And asterisk correctly starts with the user asterisk:
> $ ps aux | grep asterisk
> root      9448  0.0  0.0 106092   672 pts/0    S    15:53   0:00 /bin/sh /usr/sbin/safe_asterisk -U asterisk -G asterisk -c
> asterisk  9450  1.6  2.6 1151832 27520 pts/0   Sl   15:53   0:00 /usr/sbin/asterisk -f -U asterisk -G asterisk -c -vvvg -c
> root      9495  0.0  0.0 103244   828 pts/0    S+   15:53   0:00 grep asterisk
> But start asterisk using the daemon function (called by /etc/init.d/rc.d/asterisk) and the -U and -G flag is ignored:
> $ . /etc/rc.d/init.d/functions
> $ daemon sh -c "/usr/sbin/safe_asterisk -U asterisk -G asterisk -c"
>                                              [  OK  ]
> $ ps aux | grep asterisk
> root      9510  0.0  0.0 106092   676 pts/0    S    15:55   0:00 /bin/sh /usr/sbin/safe_asterisk
> root      9512  4.6  2.6 1151884 27316 pts/0   Sl   15:55   0:00 /usr/sbin/asterisk -f -vvvg -c
> root      9556  0.0  0.0 103244   832 pts/0    S+   15:55   0:00 grep asterisk

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira



More information about the asterisk-bugs mailing list