I have a process that I want to start as soon as my system rebooted any way, so I used an upstart script for this, but sometimes what I notice is that my process does not start during a hard reboot (shutdown and starting the machine), so I think that my upstart script will not load after a hard reboot. I believe that for Hard Reboot there is no runlevel.
I am confused that sometimes during reboot it works, but sometimes it does not work. And how can I debug this?
Below is my upstart script:
# sudo start helper # sudo stop helper # sudo status helper start on runlevel [2345] stop on runlevel [!2345] chdir /data respawn pre-start script echo "[`date`] Agent Starting" >> /data/agent.log sleep 30 end script post-stop script echo "[`date`] Agent Stopping" >> /data/agent.log sleep 30 end script limit core unlimited unlimited limit nofile 100000 100000 setuid goldy exec python helper.py
Is there any way to debug this from what is happening? I can easily reproduce this, I believe. Any pointers to what I can do here?
Note:
During the reboot, sometimes I see the log that I have in the pre-start script, but sometimes I do not see logging at all after the reboot, which means that my script upstart did not start. Is there something I need to change at runlevel to make it work?
I have a virtual machine that runs in Hypervisor and I work with Ubuntu.
john
source share