Normally in Gentoo you would want to create an init script via rc-update to start a service at boot. However if there are a few miscellaneous commands you would like to run you can add them to local.start.
The local.start init script is similar to rc.local in other distributions. It is the last init script to be run after all other services have been started at the end of the boot process.
Add your commands to local.start file located here.
/etc/conf.d/local.start
You can also make commands run when the system is shutdown. These commands should be placed in local.stop located here.
/etc/conf.d/local.stop
Comments (4)
on November 21, 2010 at 5:10 pm
thanks this helped
on March 17, 2011 at 8:03 am
Thanks a lot , I was struggling with wicd and all
on May 20, 2011 at 3:10 pm
The openRC /baselayout2 updgrade changed this.
From /etc/init.d/local
start()
{
einfo “Starting local”
local file
for file in /etc/local.d/*.start ; do
[ -x "$file" ] && “$file”
done
if type local_start >/dev/null 2>&1; then
ewarn “/etc/conf.d/local should be removed.”
ewarn “Please move the code from the local_start function”
ewarn “to scripts with an .start extension”
ewarn “in /etc/local.d”
local_start
fi
return 0
}
meaning that /etc/local.d/ is the proper place to put scripts ending with .start that you want executed when the local level starts.
on September 23, 2011 at 6:58 pm
Thank you WorBlux
After searching Google for a bit resulting in 08-dated responses, yours was what I was looking for.
(My /etc/conf.d/local did not have anything to load at start or stop so once I removed the file the warning messages went away. I also noted and read the /etc/local.d/README which explains that new .start and .stop scripts are processed in lexical order.)
Your response here is appreciated!
Trackbacks (1)
on December 27, 2008 at 4:39 am