Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 864887 - net-misc/asterisk-18.8.0-r1: start process remains appended (/bin/sh /lib/rc/sh/openrc-run.sh /etc/init.d/asterisk start)
Summary: net-misc/asterisk-18.8.0-r1: start process remains appended (/bin/sh /lib/rc/...
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Jaco Kroon
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-08-11 08:49 UTC by Agostino Sarubbo
Modified: 2022-08-11 11:53 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Agostino Sarubbo gentoo-dev 2022-08-11 08:49:59 UTC
From 'ps' I noticed that the process for thei init script startup remains appeneded, following the output from ps.

 ~ # ps aux | grep asterisk
root     12244  0.0  0.1   8228  3092 ?        S    09:09   0:00 /bin/sh /lib/rc/sh/openrc-run.sh /etc/init.d/asterisk start
root     12245  0.0  0.0   5588  1032 ?        S    09:09   0:00 logger -t wrapper:asterisk
asterisk 12248  2.8  2.8 657976 56020 ?        Sl   09:09   2:49 /usr/sbin/asterisk -C /etc/asterisk/asterisk.conf -f -U asterisk


[ebuild   R    ] net-misc/asterisk-18.8.0-r1:0/18::gentoo  USE="pjproject -alsa -blocks -bluetooth -calendar -caps -cluster -codec2 -curl -dahdi -debug -deprecated -doc -freetds -gtalk -http -iconv -ilbc -ldap -lua -mysql -newt -odbc -oss -portaudio -postgres -radius (-selinux) -snmp -span -speex -srtp -ssl -static -statsd -syslog -systemd -unbound -vorbis -xmpp" LUA_SINGLE_TARGET="-lua5-1 -lua5-3 -lua5-4" VOICEMAIL_STORAGE="-imap -odbc"
Comment 1 Agostino Sarubbo gentoo-dev 2022-08-11 08:52:41 UTC
~ # strace -p 12244
strace: Process 12244 attached
wait4(-1,
Comment 2 Jaco Kroon 2022-08-11 11:53:48 UTC
Hi Ago,

This was as per original design.  The wrapper loop has since moved out, and now it looks like:

28284 ?        SN     0:00 /bin/bash /usr/sbin/asterisk_wrapper --syslog --instance xxx --rundir /run/asterisk.xxx --restartdelay 5 --dumpcore unlimited --corerename core-%H-%D-%T --maxfd 4096 -- -C /etc/asterisk.xxx/asterisk.conf -f -g -U ast_xxx
28316 ?        SN     0:00  \_ /bin/bash /usr/sbin/asterisk_wrapper --syslog --instance xxx --rundir /run/asterisk.xxx --restartdelay 5 --dumpcore unlimited --corerename core-%H-%D-%T --maxfd 4096 -- -C /etc/asterisk.xxx/asterisk.conf -f -g -U ast_xxx
28317 ?        SN     0:00  |   \_ logger -t asterisk_wrapper:xxx
28319 ?        SNl   74:11  \_ /usr/sbin/asterisk -C /etc/asterisk.xxx/asterisk.conf -f -g -U ast_xxx


(This is using the multi-instance functionality.)

I trust that this should sort you out, I still don't like the fact that there are two bash processes here, but I haven't investigated yet why that happens.  Based on the logger sub-process, I suspect it has something to do with this snippet of code:

 98 # Before here will still be output (potentially munged, to the terminal).
 99 if [[ -n "${syslog}" ]]; then
100     exec 1> >(logger -t "asterisk_wrapper${instance:+:}${instance}" &>/dev/null)
101     exec 2>&1
102 fi

from the wrapper itself.

Marking as INVALID since this is already "fixed".  The problem is that originally we used a "simple" function() inside of the init script to act as this wrapper.