Ubuntu – How to start program on boot in Ubuntu 14.04

bootcronrootstartupUbuntu

Is the root crontab the only way? I'm starting up a MC server and don't want it to need me to manually restart it each time the server reboots for whatever reason. I don't want any login required for these programs to initialise.

I'm using ssh to get into this server, it's a VPS, nothing local.

Best Answer

There are more than one way to accomplish this.

  1. You can put your startup script in /etc/init.d and make it resemble to one of the existing scripts over there. But depending on your Linux comfort level, this may be a little daunting.

  2. You can make this a service and make the service start at the boot time. Just do a google search on "how to make my program a service" and you will come across a lot of pages. More than what you can shake a stick at.

  3. If your app is startin g with one single command and is not dependent on anything else, you can add the start-up command at the end of /etc/rc.local file.

You can also put it in the cron to execute at the startup but this is not the way it should be done, in my opinion

Related Question