Run arbitrary commands at boot time?

Rocco Stanzione grasshopper at linuxkungfu.org
Fri Mar 10 00:57:15 GMT 2006


On Thursday 09 March 2006 18:04, Colin Watson wrote:
> > Back in my Mandrake days we had a file, /etc/rc.local, where we could put
> > arbitrary commands to be executed with root privileges at the end of the
> > init stage, just before the login prompt or ?dm was presented.  A *very*
> > frequently asked question on irc is where to put a script or command to
> > run like this, and there doesn't seem to be a very good answer.
>
> Copy /etc/init.d/skeleton to a new file in /etc/init.d/, edit it to suit
> your needs, and run update-rc.d to cause it to run whenever you want.

Never noticed that file before.  It looks like a good solution if I want to 
put an init script together with start and stop, assign it to the appropriate 
runlevels, etc., but often I simply want a single command to be executed at 
boot time, and I might not have the bash foo necessary to make a decent init 
script.  Whether I do or not, and whether the skeleton file is sufficiently 
well self-documented to get me through it or not, we're looking at a solution 
that would probably take close to an hour to do right when there's no good 
reason I shouldn't be able to echo "some_command --with-args" >> /some/file 
and be done with it.



More information about the ubuntu-devel mailing list