0

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.

1 Answer 1

2

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!

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .