Start Up Scripts

sean.ferguson

OSNN Veteran Addict
Joined
4 Jul 2003
Messages
1,693
How can I write a script that will run a program ( ~/folding/FAH502 ) everytime the server boots up.

I know that cronjobs can run things at a certain time, but my server isnt important enough to warrant purchasing a UPS so when we have a powercut i need to run around and restart all my running apps. Is there a way I can put these in a script that can be run on system boot?

Ideally I would like a screen session to be opened first, and then the program in question ran. That way I can manage the progress etc remotely without needing local access to the machine.
 
Last edited:

X-Istence

*
Political Access
Joined
5 Dec 2001
Messages
6,498
Depending on the linux flavour of the week, create a script in either:

/etc/init.d
/etc/rc.d
/etc/runlevel.d

Or if it is FreeBSD:

/usr/local/etc/rc.d

And just prepend the command to be run by a "screen" and it will be executed in a screen.
 

sean.ferguson

OSNN Veteran Addict
Joined
4 Jul 2003
Messages
1,693
Thanks X, the flavour is Slackware 10.2 and I have just been speaking to someone on YIM who has said that there is a crontab special flag "@reboot" - I wasn't aware of such flags.

So in that case I have just added the following line to my users crontab

Code:
@reboot screen -d -m ~/folding/FAH504-Linux.exe

I'l have a look at those files also though, just to make myself familiar
 

Members online

No members online now.

Latest profile posts

Electronic Punk wrote on Sazar's profile.
Rest in peace my friend, been trying to find you and finally did in the worst way imaginable.
Terrahertz wrote on Electronic Punk's profile.
Yo fellas!
Electronic Punk wrote on Sazar's profile.
Where are you buddy?
Perris Calderon wrote on Electronic Punk's profile.
Hey EP! All good with me, applying for Microsoft MVP right now, should have done this a while ago.

Notifications don't work, I only found your response by coming back to hunt up some threads, if you want, give me your email address so we can keep in touch easier!
Perris Calderon wrote on Electronic Punk's profile.
EP, glad to see you come back and tidy up...did want to ask a one day favor, I want to enhance my resume , was hoping you could make me administrator for a day, if so, take me right off since I won't be here to do anything, and don't know the slightest about the board, but it would be nice putting "served administrator osnn", if can do, THANKS

Been running around Quora lately, luv it there!

Forum statistics

Threads
61,997
Messages
673,411
Members
5,591
Latest member
nodee