Is there a way to do this so when I reboot my linux server the process will reopen on startup?
Asked
Active
Viewed 280 times
1 Answers
8
Usually, you need to add a startup script in /etc/rc.d/
or /etc/rc.local
. Thats how all daemons are started. However you need to have root permissions for this.
Since you tagged it as ssh, I guess you don't have root permissions. So you can create a crontab entry that runs a script to launch your process after every reboot:
$ crontab -e
Add the following line in the file that opens up:
@reboot /path/to/your_script.sh

jman
- 425
- 2
- 7
-
Good Idea. I will try that. After adding the cron, how would I remove it if needed to. – Oct 02 '11 at 06:28
-
Same as before. crontab -e and delete that line from the file – jman Oct 02 '11 at 06:29
-
When trying the command crontab -e it respods "no crontab for (myusername)" How do I make one? – Oct 02 '11 at 06:50
-
Strange, it should create one (after complaining) if there isn't any. What version of linux are you on? – jman Oct 02 '11 at 06:56
-
Basic 64-bit Amazon Linux AMI 2011.09 – Oct 02 '11 at 06:57
-
Never mind. fixed it the vi editor wasn't saving. – Oct 02 '11 at 07:16
-
Now, if I had root access how would I do this? – David Meyer Oct 04 '11 at 19:27
-
You could add a line in /etc/rc.local. That is a script run after everything else is initialized on the system. – jman Oct 04 '11 at 19:43