I'm making a simple upstart daemon.
Following the Upstart documentation[1] I make the conf script:
description "Super Daemon"
author "Bastian Baltasar Bux"
start on started dbus
stop on runlevel [06]
expect fork
exec /usr/bin/my-daemon
The script /usr/bin/my-daemon
is a bash that call a python. The python script log information in a /var/log file. On that python script, I only make a fork
. But when I check the forks like says in the Upstart doc [2], the method says that I do twice forks.
With that all, the start job is executed correctly, but the pid showed with the upstart my-daemon status
isn't the same that is in the log file. The error appears when I try to stop doing status my-daemon stop
. That command doesn't end, I must to finish with Crtl-C.
I tried to change the expect fork
to expect daemon
but service stop doesn't ends neither.
When could be the problem?
sudo stop my-daemon
?initctl stipo my-daemon
exec /usr/bin/my-daemon
toexec python $MY_SCRIPT_PATH
solve the issue. I think the problem is in the bash scritp that doesn't fork any time.