I'm trying to run a service when the system starts up by following this tutorial
I have a script named service
.
To make it run on startup, I ran
sudo update-rc.d service enable
and then rebooted using sudo reboot
and it works.
I'm curious as to whether I need to add a respawn line or not since it is used in this article. In my case it works even I do not add that line.
Add a respawn line for this service at the bottom of the
/etc/inittab
file. Here's a generic example:/etc/inittab id:2345:respawn:/bin/sh /path/to/application/startup
My Ubuntu version : 14.04
/etc/inittab
, it is really outdated. No current version of Ubuntu uses it. What version are you using? – muru Feb 08 '17 at 04:32/etc/init.d/
scripts. – muru Feb 08 '17 at 04:34inittab
(which isn't used anyway),init.d
scripts can't. – muru Feb 08 '17 at 04:36init.d
without respawn it still working fine. Can you explain more ? I'm new to Ubuntu and Linux. Thanks a lot. – John Joe Feb 08 '17 at 04:47