[Pkg-stud-maintainers] Bug#725797: Bug#725797: stud: Fix failure to run stud restart

Louis Bouchard louis.bouchard at canonical.com
Wed Oct 9 09:11:23 UTC 2013


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Bonjour,

Le 09/10/2013 08:47, Vincent Bernat a écrit :
> 
> How does this work for multiple stud instances? I didn't know that 
> start-stop-daemon does not wait for the process to terminate by 
> default. Maybe we should use --retry instead.
> 

If by multiple instances you mean many configuration files in
/etc/stud I haven't tested. If you mean multiple children (or cores)
started by the -n option, this is indeed what it is trying to fix.

By default, stud starts a main process and one child (-n1). When
- --pidfile is in use, only the main process gets killed as implied in
the manpage of start-stop-daemon :

"Note: unless --pidfile is specified, start-stop-daemon behaves
similar to killall(1).
...
For daemons which have long-lived children which need to live through
a --stop, you must specify a pidfile."

So when using --pidfile, children are not sent the signal, only the
main process. This is what I have witnessed by inserting an 'lsof -i
@127.0.0.1:8445" at the beginning of do_start : there are still
processes present.

Regarding using --retry, it is already being used :

start-stop-daemon --stop --quiet --retry=TERM/10/KILL/5 \
                                --pidfile $PIDFILE --name $NAME

Here again, --retry only touches the main process, not the children
when used in conjunction with --pidfile.

Testing this is rather easy : just run invoke-rc.d stud restart and
you will notice that stud processes do not come back. This is caused
by the fact that the first test in do_start also uses --pidfile and,
since the main process is gone, it concludes that it can go ahead but
when it starts stud, other processes still have to socket open so the
start fails.

Removing the --pidfile will make sure that the main process and all
remaining children get killed.

Adding --user $USER is required otherwise the initscript itself gets
killed (since it is also named stud). The only problematic situation
is if stud is run as root ($USER=root) where --user cannot discriminate.

I have been trying to find you on OFTC without success. You can reach
me there, my nick is caribou.

Kind regards,

...Louis
- -- 
Louis Bouchard
Software engineer, Cloud & Sustaining eng.
Canonical Ltd
Ubuntu support: http://canonical.com/support
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iEYEARECAAYFAlJVHbUACgkQDvqokHrhnCwBRQCfTQH6gQCdrFFJR7XjKtwdRRL8
+c8An2Mc6gO3T2CCzEpsSZ0oaynaHrkA
=fJMr
-----END PGP SIGNATURE-----



More information about the Pkg-stud-maintainers mailing list