i tried to understand this behaviour

it seems the way perl handle process name update ($0) has changed
http://perldoc.perl.org/5.14.0/perldelta.html

Assignment to $0 sets the legacy process name with prctl() on Linux
On Linux the legacy process name is now set with prctl(2), in addition to altering the POSIX name via argv[0] , as Perl has done since version 4.000. Now system utilities that read the legacy process name such as ps, top, and killall recognize the name you set when assigning to $0 . The string you supply is truncated at 16 bytes; this limitation is imposed by Linux.


it seems to disturb init.d script which use --name MailScanner option to check if the daemon is running

Check for processes with the name process-name (according to /proc/pid/stat).

but this file does not contain MailScanner but a longer string for example for the process " MailScanner: master waiting for children, sleeping"
21283 (MailScanner: ma) ...

with previous perl version, it contains 14302 (MailScanner) ...

so init.d script considers always MailScanner is not running:
- stop doesn't work
- start will launch a new daemon instance each time it is called (especially via /etc/cron.daily/mailscanner)

so init.d script should be fixed to use another method to find daemon instance (may be using /var/run/MailScanner/MailScanner.pid)

# start-stop-daemon -v --start --startas MailScanner --name MailScanner --test
Would start MailScanner .

v# start-stop-daemon -v --start --startas MailScanner --pid /var/run/MailScanner/MailScanner.pid --test
process already running.



sample init.d diff
86a87
> PIDFILE=`${QUICKPEEK} 'PID file' ${CONFFILE}`
102c103
< start-stop-daemon --start --quiet --startas $STARTAS --name $NAME --test > /dev/null \
---
> start-stop-daemon --start --quiet --startas $STARTAS --pidfile "$PIDFILE" --test > /dev/null \
104c105
< start-stop-daemon --start --quiet --nicelevel $run_nice --exec $DAEMON --name $NAME -- $DAEMON_ARGS \
---
> start-stop-daemon --start --quiet --nicelevel $run_nice --exec $DAEMON --pidfile "$PIDFILE" -- $DAEMON_ARGS \
126c127
< start-stop-daemon --stop --quiet --retry=TERM/10/TERM/20 --name $NAME
---
> start-stop-daemon --stop --quiet --retry=TERM/10/TERM/20 --pidfile "$PIDFILE"
143c144
<       start-stop-daemon --stop --signal 1 --quiet --name $NAME
---
>       start-stop-daemon --stop --signal 1 --quiet --pidfile "$PIDFILE"




--
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]

Reply via email to