Ubunti - Running scripts at startup

Soldato
Joined
12 Jan 2006
Posts
2,547
Ubuntu - Running scripts at startup

Hi all, just a quick and hopefully simple problem i was wondering someone could help me with

I want to run a custom script /script/myscript.pl in the background at startup, ideally this would be done before logon so its running regardless to whether someone logs on or not.

Now my problem is that the script is required to parse system logs so never ends, when added to the init.d the script will start but the session will hang at start up as it waits for inputs from the logs rather than continuing to boot

Is there any way to start this script in the background while allowing the system to boot normally

I am a complete linux noob so step by step instructions would be much appreciated

Thanks in advance for any help
 
Last edited:
This might not be the most elegant way of doing it, but if you suffix the command in init.d with && it will return the system to its business while keeping the script running. Try it at the command line with something like
top &&

It will be running top but you can't see it since it returned you to control of your shell.
 
Yeah a single ampersand tells the shell to run the preceding command in the background... I use this a lot. Not sure what double ampersands means.
 
double ambersands means the same as a semi colon, eg for running two applications/commands at once...

/me shudders from the painful experience of writing a shell and having to parse single and double ambersands, left angle bracket, right angle bracket, double right angle bracket, pipe and semi colon, horrible horrible code... :p
 
Back
Top Bottom