Search:  
Gentoo Wiki

Rc-update


Contents

Introduction to rc-update

rc-update is a script for adding/removing/listing available scripts to the boot, default and nonetwork run levels of your computer. these scripts allow you to run programs at your computers boot time.

rc-update is very useful and can be used to start anything from your network card to your login manager.

rc-update commands

adding a script to a runlevel

rc-update add script runlevel

will add a script to that runlevel of your computer.

removing a script from a runlevel

rc-update del script runlevel

will remove a script from the runlevel.

list available scripts and their current runlevel

rc-update show

will show all available scripts and their currently set runlevel(s) if any.

If not, you probably have an old version. run emerge -avD world to update your gentoo installation.

runlevels

more run levels may be added to /etc/runlevels/

examples

rc-update add net.eth0 default

This will set your network to load at the default runlevel

rc-update del net.eth0

this will remove net.eth0 from all runlevels its assigned

other information

rc update uses scripts in the /etc/init.d/ directory exclusively

orphaned rc scripts

After using Gentoo for a while and merging and unmerging several packages, you may find some rc scripts in /etc/init.d whose associated packages have been unmerged.

You can see which package each of your rc scripts and config files belongs to with this command:

for each in /etc/{conf,init}.d/* ; do \
  echo -n "$each " ; \
  equery belongs -e "$each" | fgrep / || \
    echo '!!! ORPHAN !!!' ; \
done

Note that this command takes quite a while to run and requires gentoolkit.

If you have portage-utils installed, then a much faster version of this script can be used instead:

for each in /etc/{conf,init}.d/* ; do \
  qfile "$each" >/dev/null || \
    echo $each: '!!! ORPHAN !!!' ; \
done

see also

rc-status

Retrieved from "http://www.gentoo-wiki.info/Rc-update"

Last modified: Wed, 23 Jul 2008 11:36:00 +0000 Hits: 31,429