LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 12-18-2012, 07:14 AM   #1
gbao256
LQ Newbie
 
Registered: Dec 2012
Posts: 10

Rep: Reputation: Disabled
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!

Last edited by gbao256; 12-18-2012 at 07:16 AM.
 
Old 12-18-2012, 08:44 AM   #2
nicklasp
LQ Newbie
 
Registered: Nov 2011
Posts: 1

Rep: Reputation: Disabled
Appending an ampersand ( & ) to the command runs the job in the background.
 
Old 12-18-2012, 08:50 AM   #3
Habitual
LQ Addict
 
Registered: Jan 2011
Location: Youngstown, Ohio
Distribution: LM17.1/Xfce4.11.8
Posts: 7,163
Blog Entries: 10

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

Code:
/path/to/deluge-web &
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] sending a startup program to the background zasavage Slackware 2 12-19-2011 09:16 AM
run program in background karabaja4 Linux - Newbie 3 01-05-2008 01:57 PM
How to start 2 background program at startup, one depends on the other? sedan258 Linux - Newbie 5 09-22-2006 08:30 PM
running java program at startup in background Maverick1182 Linux - Newbie 4 09-19-2006 07:09 PM
Run a program in the background??? KaptinKABOOM Linux - Software 5 07-06-2004 07:40 AM


All times are GMT -5. The time now is 04:54 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration