Summary: | ASTERISK-20851: Asterisk user/group flags ignored by daemon function in /etc/rc.d/init.d/functions | ||
Reporter: | Sverre G (sverre) | Labels: | |
Date Opened: | 2013-01-01 23:01:08.000-0600 | Date Closed: | |
Priority: | Major | Regression? | |
Status: | Open/New | Components: | Contrib/General |
Versions: | 10.8.0-digiumphones 13.18.4 | Frequency of Occurrence | Constant |
Related Issues: | |||
Environment: | CentOS release 6.3 | Attachments: | |
Description: | 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 | ||
Comments: | By: Sverre G (sverre) 2013-01-02 17:38:37.387-0600 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 By: Sverre G (sverre) 2013-01-02 21:14:49.360-0600 Also note that if you leave /etc/sysconfig/asterisk alone (don't change the AST_USER or AST_GROUP variables, and leave COLOR=yes all as the defaults), and instead put the user in /etc/asterisk/asterisk.conf - all starts up with the correct user. Maybe AST_USER and AST_GROUP are depreciated and should be removed entirely? |