Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I'm trying to setup with Upstart a python script that launch several internal procs and kill them if is required with this sentences:

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

My Upstart file:

# 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

I'm wondering how use the python script command in order to finish the service, if I try to stop with :

$ sudo service listener stop
$ stop: Unknown instance:

Its fails, my upstart file only start the services but doesn't work when I try to stop it. What I'm missing?

share|improve this question

1 Answer 1

Well, taking the plymouth.conf example I add 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

Now all is working fine..

share|improve this answer

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.