/srv/irclogs.ubuntu.com/2012/03/22/#upstart.txt

codebeakerhow can I (easily) HUP to reload a process13:29
codebeakereverything says "initctl reload <myjob>" - but as far as I can ascertain that's simply for reloading initctl's config file for that job13:30
codebeakerI'm wroking with three daemons which respond to HUP by seamlessly rebooting themselves with zero-downtime13:30
codebeakerI don't really feel like going back to systemv init scripts, or reading pidfiles and sending HUPs - especially as that causes upstart to lose track of them when their PID changes13:31
ionParse the pid from the output of initctl status job, send HUP to that.13:37
ionpid=; eval "$(initctl status foo | sed -nre 's|^cron start/running, process ([0-9]+)$|pid=\1;|p')"13:39
ionif [ -n "$pid" ]; then …13:40
codebeakerthanks ion, that's a bit cleaner14:02
codebeakerbut when teh pid changes, initctl will still lose track of it, right ?14:02
codebeaker(sorry, didn't see your response)14:02
ionIf the pid changes, please file a bug report against the daemon. :-P14:04
codebeakerheh14:25
codebeakerUnicorn (web server) treats a USR2 as an invitation to reload itself, it spawns a new master process - and replaces the old one as the worker processes complete their tasks14:26
codebeakerso that's a perenial problem14:26
codebeakerand in Rails land, booting an application takes 45 seconds14:26
ionPerhaps Unicorn could have a very thin parent process that just keeps the child running and dies if the child dies. That would result in a constant pid.14:28
SpamapScodebeaker: initctl reload does in fact send HUP to the tracked pid15:32
codebeakerbut it says that it's used for reloading the initctl script15:33
SpamapScodebeaker: anything that forks and then exits multiple times in its lifecycle cannot be tracked by upstart15:33
SpamapScodebeaker: wrong, that is reload-configuration15:33
codebeakerok, so that is "restart" is a stop/start15:33
SpamapSyes, restart also does not reload the job file between stop/start15:34

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