Run a command at boot with Gentoo

by
on
October 27, 2008

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

5 Comments
gentoo
, , , , , ,

Related posts:

  1. Upgrade Gentoo Linux Kernel
  2. Setup NFS server on Gentoo
  3. Update your entire Gentoo Linux system
  4. Set DHCP timeout in Gentoo
  5. Install the GRUB boot loader to the MBR

Comments (4)

thanks this helped

Thanks a lot , I was struggling with wicd and all :)

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.

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!

Leave a Comment

(displayed with your post)
(will not be published)
(optional)

Copyright 2008-2010 WiredRevolution.com. All rights reserved.