/srv/irclogs.ubuntu.com/2013/03/20/#upstart.txt

=== JanC_ is now known as JanC
you-tee-fhow can i change the default run level ?19:12
jYstart on runlevel [2345]19:15
jY?19:15
SpamapS/etc/init/rc-sysinit.conf, btw, if he comes back19:35
herriojrhello23:04
herriojrI'm having a hard time following documentation on how to handle this scenario:23:04
herriojrI have a daemon which can be started and stopped by calling "daemon start" and "daemon stop" respectively23:05
herriojrnow, initctl will send out the sigterm signal itself, but the daemon catches the sigterm and waits until it is actually safe to shut down, so it can take X amount of time23:06
SpamapSherriojr: initctl does not send any signals23:08
SpamapSherriojr: it tells upstart to send them from pid 123:08
SpamapSherriojr: if you have an expected lag for your kill signal, you can use 'kill timeout'. man 5 init shows that.23:09
herriojryes, ok, so is it safe to put the "daemon stop" in pre-stop to force it to wait (daemon stop will wait until the daemon has exited before returning)23:09
herriojrSpamapS: the issue is due to the nature of the daemon, it's safe point is undetermined23:09
SpamapSherriojr: you mean due to the fact that it doesn't handle SIGTERM properly by shutting down gracefully?23:10
herriojrSpamapS: yes, and I didn't write the daemon, so I'm having to work around it23:10
SpamapSherriojr: or due to the fact that upstart doesn't know its pid, because you need to use pre-stop and post-start to send the 'daemon start' and 'daemon stop' commands?23:10
herriojrso it's written like: do some undetermined amount of work; check if sigterm was sent and if so, exit23:11
SpamapSherriojr: upstart does not have to track a daemon's pid. You can defer that to those programs by using post-stop (don't use pre-stop) and post-start to run the stop/start commands.23:11
herriojrwould that mess up a restart?  meaning, restart sends a stop followed by a start and if it wasn't stopped in time, this daemon could get screwed up23:12
SpamapSrestart is 100% broken and does not run pre-stops actually23:13
herriojrok23:13
SpamapS(thats why I say, don't use pre-stop)23:13
herriojrgreat to know23:13
herriojrhaha ok23:13
herriojrty623:13
herriojrty23:13
SpamapSbut I would actually avoid restart if you can23:13
herriojrI think that might be enough information for me to try some things out23:13
herriojrthanks23:13
herriojrkk23:13
SpamapSif you use the 'service' command, it does stop/start23:14
herriojrok thanks23:15

Generated by irclog2html.py 2.7 by Marius Gedminas - find it at mg.pov.lt!