0

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?

0

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..

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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