xaka | why "stop" would hang? | 11:56 |
---|---|---|
xaka | start works, tracking PID is corret, when i do stop the process finishes succesfully, but the command itself hangs | 11:56 |
jodh | xaka: what does "initctl status <job>" show? maybe you 'post-stop' is still running? | 13:14 |
xaka | i don't have post-stop. after some time i stopped it by Ctrl+C. status is "stop/killed, pid ...". then i tried to start it again and even start hanged | 13:16 |
jodh | xaka: can you show me the conf file? | 13:18 |
xaka | jodh: http://pastebin.com/nMV1s7YD | 13:21 |
jodh | xaka: firstly, you need to be careful with those pre-start commands since if any fail, the job will not run. See http://upstart.ubuntu.com/cookbook/#develop-scripts-using-bin-sh | 13:23 |
xaka | jodh: i understand, but that pre-start is the only solution for my case that i was talking about yesterday here | 13:24 |
jodh | xaka: are you sure that Upstart is tracking the pid correctly? Does "nms" definately fork only once? | 13:24 |
xaka | it starts with no issues, after that "status" shows correct PID | 13:25 |
xaka | it even stops the process, but "stop" command doesn't finish | 13:25 |
xaka | jodh: i have the simple script that you can use to reproduce the situation, let me paste it | 13:26 |
xaka | jodh: http://pastebin.com/jityDGxg ( don't ask why it's been written in this way :) ) | 13:28 |
xaka | jodh: btw, are you going to add support for dependencies like SMF has? i was talking/complaing about it yesterday. i want to say that B depends on A so when B is started and A isn't running yet, A has to be started first. | 13:32 |
xaka | that is the only reason i have that pre-start hook - i don't want (and i haven't) to modify ntp/mongodb conf files, but i still want to be sure that the services are running | 13:33 |
jodh | xaka: the problem is that your perl script is attempting to "manage" the service by killing the child. However, you've told Upstart that the child PID *is* the service so Upstart is tracking the forked child process. Either remove the "expect fork" or stop the perl script from killing the child - Upstart will do that for you as it kills the process group. | 13:43 |
xaka | jodh: the wrapper doesn't kill the child (those INT/TERM handles only for developers). the simple is chain is: fork->exec->waitpid | 13:52 |
xaka | btw, does the upstart kill the process group of forked child or the parent? | 13:53 |
jodh | xaka: please see my comments above. | 13:53 |
kevmo | How can you tell upstart to get the pid from a pid file on the stop command | 21:25 |
Generated by irclog2html.py 2.7 by Marius Gedminas - find it at mg.pov.lt!