LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   How to make a program run background when startup with rc (https://www.linuxquestions.org/questions/linux-newbie-8/how-to-make-a-program-run-background-when-startup-with-rc-4175441947/)

gbao256 12-18-2012 06:14 AM

How to make a program run background when startup with rc
 
Hi everyone.
I have a VPS for torrent. I'm using deluge web. I can bind it run background manualy like this:
deluge-web&
crtl-z
exit
But I have a crontab to refresh my VPS by reset it each 2 days. Because my vps dont have enough ram.And every time my vps restart I have to start deluge manual so. I thinks I need to write bash for this. But I dont know how to.
I know how to write a bash in start up

sudo mv /filename /etc/init.d/
sudo chmod +x /etc/init.d/filename
sudo update-rc.d /etc/init.d/filename defaults

but I dont know how to call "crtl-z" with bash.
Please help me!

nicklasp 12-18-2012 07:44 AM

Appending an ampersand ( & ) to the command runs the job in the background.

Habitual 12-18-2012 07:50 AM

Edit /etc/rc.local and stick this in there above/before 'exit 0'

Code:

/path/to/deluge-web &


All times are GMT -5. The time now is 12:18 PM.