[11:56] <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 
[13:14] <jodh> xaka: what does "initctl status <job>" show? maybe you 'post-stop' is still running?
[13:16] <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:18] <jodh> xaka: can you show me the conf file?
[13:21] <xaka> jodh: http://pastebin.com/nMV1s7YD
[13:23] <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:24] <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:25] <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:26] <xaka> jodh: i have the simple script that you can use to reproduce the situation, let me paste it
[13:28] <xaka> jodh: http://pastebin.com/jityDGxg ( don't ask why it's been written in this way :) )
[13:32] <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:33] <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:43] <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:52] <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:53] <xaka> btw, does the upstart kill the process group of forked child or the parent?
[13:53] <jodh> xaka: please see my comments above.
[21:25] <kevmo> How can you tell upstart to get the pid from a pid file on the stop command