Hardware Reference
In-Depth Information
For all run levels except 0 and 6, the action being performed by the /etc/init.d/rc
script is to start services (except where kill scripts apply). Entering run level 0 (halt) or 6
(reboot) is a bit different, since the script must be stopping services.
The following is an example list of startup scripts used by the Raspberry Pi when
entering run level 2 after booting:
$ ls −lL /etc/rc2.d/S
−rwxr−xr−x 1 root root 1276 Aug 31 2012 /etc/rc2.d/S01bootlogs
−rwxr−xr−x 1 root root 4698 May 1 2012 /etc/rc2.d/S01ifplugd
−rwxr−xr−x 1 root root 995 Aug 31 2012 /etc/rc2.d/S01motd
−rwxr−xr−x 1 root root 3054 Sep 26 2012 /etc/rc2.d/S01rsyslog
−rwxr−xr−x 1 root root 714 Jun 28 2012 /etc/rc2.d/S01sudo
−rwxr−xr−x 1 root root 3169 May 10 2011 /etc/rc2.d/S01triggerhappy
−rwxr−xr−x 1 root root 3033 Jul 9 2012 /etc/rc2.d/S02cron
−rwxr−xr−x 1 root root 2832 Sep 29 2012 /etc/rc2.d/S02dbus
−rwxr−xr−x 1 root root 2148 Jun 9 2012 /etc/rc2.d/S02dphys−swapfile
−rwxr−xr−x 1 root root 1814 Dec 26 2009 /etc/rc2.d/S02ntp
−rwxr−xr−x 1 root root 4395 Dec 13 06:43 /etc/rc2.d/S02rsync
−rwxr−xr−x 1 root root 3881 Feb 24 2012 /etc/rc2.d/S02ssh
−rwxr−xr−x 1 root root 1313 Jun 30 2012 /etc/rc2.d/S04plymouth
−rwxr−xr−x 1 root root 782 Mar 16 2012 /etc/rc2.d/S04rc.local
−rwxr−xr−x 1 root root 1074 Mar 16 2012 /etc/rc2.d/S04rmnologin
Like many Linux distributions, Raspbian Linux places the actual script files in the
directory /etc/init.d . The names found in /etc/rc2.d , for example, are symlinks to the
actual files.
It should also be noted that these scripts are run in the order determined by the pair
of digits following the S or K prefix. This is a natural consequence of the way the shell sorts
file names when listing files.
inittab Action wait
The wait init action is useful for entries that you want to run individually when the new
run level is first entered. The init process will not resume with further entries until the
launched process has terminated (whether launched successfully or not). Presumably,
there is an implied order based on line sequence found in the file. An important attribute
of this type of entry is that it is performed only once upon starting the run level.
inittab Action once
The once action is very similar to the wait action, except that the init process will not
wait for the started process to terminate (perhaps it doesn't). Entries marked once are
started only once per entry of a given run level, but init then proceeds with immediately
processing other entries.
 
Search WWH ::




Custom Search