Newbie question, sorry - I've been googling 'start automatically on reboot ubuntu' and the like, but I'm not sure I've found the definitive answer.
I'm using Ubuntu 10.04 and I would like to make sure that heartbeat starts automatically whenever the server reboots.
Currently I am running the following manually:
$ /etc/init.d/heartbeat start
How can I make sure this is called whenever the server restarts?
One answer I googled suggested:
$ update-rc.d heartbeat defaults
would do the trick - is that correct?
Type
update-rc.d heartbeat defaults
and it will be starting automaticly after reboot
if you wanna turn it off type 'update-rc.d -f heartbeat remove`
It should. Basically, the startup process doesn't actually look in /etc/init.d, it looks in /etc/rc2.d (or whatever is defined as the startup run level). The files in /etc/rc2.d should be symlinks to files in /etc/init.d:
and so on.
For Heartbeat to start up on boot, it should have a symlink along those lines.
You can create these links manually, but Ubuntu uses the update-rc.d command to manage those symlinks, so you don't have to.
Since the /etc/rc2.d directory is root-owned and permissioned, you will need to actually run:
to run the command with superuser permissions. When it runs, it should show you the set of symlinks it will create. In addition to the one in /etc/rc2.d, it should put similar links in the other /etc/rc?.d directories, including links in /etc/rc6.d (for example) to shut down the service as the box shuts down.
try running the script again, some scripts just say they are started and dont complain at all. Also if I am not mistaking, what you are doing is saying run this script heartbeat, BUT you are not giving the script any arguments. (If I understand this page correctly)
What you can do is make a script named foo with :
make it executable with chmod +x
and then run the command update-rc.d foo defaults
It will run all the commands in the foo script on boot up.