Need "rc.local", Ubuntu doesn't have one

Daniel Robitaille robitaille at gmail.com
Thu Dec 30 23:45:20 UTC 2004


> Many distros have /etc/init.d/rc.local (place to put stuff that you want
> to run at *end* of boot process, think of it as a kind of autoexec.bat),
> and it would be great in Ubuntu too. Creating symlinks manually is mucho
> pain, and I was advised that update-rc.d isn't to be used by
> flesh-and-blood users (because it reverts the changes hone manually on
> next update), contrary to what a lot of the world seems to think,
> including the first google hit:
> 
> http://www.desktop-linux.net/debian-rclocal.htm


what I did to create a rc.local in warty

*) create  a file named "local" in /etc/init.d

*) symlink to it from /etc/rcS.d:
   ln -s /etc/init.d/local /etc/rcS.d/S99.local

That "local" file contain these lines:

===============================
#! /bin/sh
# /etc/init.d/local: execute miscellaneous commands at boot time

. /lib/lsb/init-functions
. /etc/default/rcS

PATH="/sbin:/bin"

log_begin_msg 'Loading rc.local...'

# add whatever commands to run a boot time here
#
#

log_end_msg 0

===================================

obviously it is a first draft of that type of rc.local file. 
Something more fancy would need to be done to return an error if any
of the inside commands I need to run would return  a non-zero error
for the function log_end_msg




More information about the ubuntu-users mailing list