Script running on startup (Linux)

Soldato
Joined
9 Dec 2004
Posts
5,700
Location
Dorset
Hey all,

Whats the easiest way to run a really simply script on startup in Linux? I've made a little one to bring up some virtual ethernet devices, all the guides on the web seem to conflict with each other :S

Ta :)
 
I have the follow in the rc.local file;

/root/myscript

Is that all I need to do? doesn't seem to run.
I've done a chmod +x on it ....
 
One of the reasons there is so much varied and conflicting information on the internet is that each distro seems to do this slightly differently.
So, which distro are you currently running?
 
FirebarUK said:
I have the follow in the rc.local file;

/root/myscript

Is that all I need to do? doesn't seem to run.
I've done a chmod +x on it ....


What distro you using?
 
Last edited:
/me points to his signature..

within your script, do you have the correct heading pointing to the shell you wish to execute the script?

e.g.:
Code:
#!/bin/bash
 
Hi,

Sorry this is using Centos, so RedHat.

Edit - Yep correct shell, on closer inspections it seems like the problem may be to do with udev. Thanks for your tips, I'll have a tinker and see what happens, can't try it until next week anyhow.
 
Back
Top Bottom