=== JanC_ is now known as JanC | ||
you-tee-f | how can i change the default run level ? | 19:12 |
---|---|---|
jY | start on runlevel [2345] | 19:15 |
jY | ? | 19:15 |
SpamapS | /etc/init/rc-sysinit.conf, btw, if he comes back | 19:35 |
herriojr | hello | 23:04 |
herriojr | I'm having a hard time following documentation on how to handle this scenario: | 23:04 |
herriojr | I have a daemon which can be started and stopped by calling "daemon start" and "daemon stop" respectively | 23:05 |
herriojr | now, 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 time | 23:06 |
SpamapS | herriojr: initctl does not send any signals | 23:08 |
SpamapS | herriojr: it tells upstart to send them from pid 1 | 23:08 |
SpamapS | herriojr: if you have an expected lag for your kill signal, you can use 'kill timeout'. man 5 init shows that. | 23:09 |
herriojr | yes, 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 |
herriojr | SpamapS: the issue is due to the nature of the daemon, it's safe point is undetermined | 23:09 |
SpamapS | herriojr: you mean due to the fact that it doesn't handle SIGTERM properly by shutting down gracefully? | 23:10 |
herriojr | SpamapS: yes, and I didn't write the daemon, so I'm having to work around it | 23:10 |
SpamapS | herriojr: 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 |
herriojr | so it's written like: do some undetermined amount of work; check if sigterm was sent and if so, exit | 23:11 |
SpamapS | herriojr: 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 |
herriojr | would 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 up | 23:12 |
SpamapS | restart is 100% broken and does not run pre-stops actually | 23:13 |
herriojr | ok | 23:13 |
SpamapS | (thats why I say, don't use pre-stop) | 23:13 |
herriojr | great to know | 23:13 |
herriojr | haha ok | 23:13 |
herriojr | ty6 | 23:13 |
herriojr | ty | 23:13 |
SpamapS | but I would actually avoid restart if you can | 23:13 |
herriojr | I think that might be enough information for me to try some things out | 23:13 |
herriojr | thanks | 23:13 |
herriojr | kk | 23:13 |
SpamapS | if you use the 'service' command, it does stop/start | 23:14 |
herriojr | ok thanks | 23:15 |
Generated by irclog2html.py 2.7 by Marius Gedminas - find it at mg.pov.lt!