Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I'm trying to setup in Upstart a script that launch several internal procs and kill them if is required

$ listener.py -startall
$ listener.py -killall

I can run it with this settings:

# Listener Service

description     "Listener Server"

start on runlevel [2345]
stop on starting rc RUNLEVEL=[016]

exec /home/www-data/listener/bin/listener.py -startall

pre-stop        exec /home/www-data/listener/bin/listener.py -killall

But I'm wondering how run the command listener.py -killall to finish the service:

$ sudo service listener stop
$ stop: Unknown instance:

My upstart script only start the services but doesn't work when I try to stop it.

Thanks in advance.

share|improve this question
add comment

1 Answer

At Ubuntu plymouth.conf have some similar things with my case, then like plymouth.conf I added to my upstart script a sentence to mark the service like a process that fork more procs: expect fork

# Listener Service

description     "Listener Server"

start on runlevel [2345]
stop on starting rc RUNLEVEL=[016]

expect fork

exec /home/www-data/listener/bin/listener.py -startall

pre-stop        exec /home/www-data/listener/bin/listener.py -killall

And now all is working Ok!

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.