Hardware Reference
In-Depth Information
Halt and Reboot
Changing to level 0 (halt) or 6 (reboot) requires stopping all services. As a result, in this
case only the kill scripts are performed with the argument stop . In the file
/usr/share/doc/sysv-rc/README.runlevels
you will find this remark:
In the future, the /etc/rc6.d/SXXxxxx scripts MIGHT be moved to /etc/rc6.d/
K1XXxxxx for clarity.”
Creating a New Service
If you had a dedicated application for your Raspberry Pi, you might want to assign it to
a dedicated run level, perhaps 4. In this manner, you could still perform maintenance
and perhaps even development in run level 2. When it was time to start the dedicated
application, you'd use telinit to change to run level 4. You could even have
/etc/inittab cause a reboot directly into level 4, by the following entry:
id:4:initdefault:
Rebooting directly to your custom run level 4 would be useful for solar applications
to handle restarts due to power fluctuations.
To arrange the startup/kill scripts, you would need the following:
1.
Kill scripts at the following locations (symlinks to
/etc/init.d/service ). These apply when you change from
level 4 to one of the other levels, where you don't want the
service running.
a. /etc/rc2.d/KXXservice
b. /etc/rc3.d/KXXservice
c. /etc/rc5.d/KXXservice
d.
Note that single-user mode by default will not have other
services left running.
2. You will need a startup script for run level 4:
a. /etc/rc4.d/SXXservice
In the preceding script, XX is a sequence number (00 to 99) that positions where in
the list of scripts it gets executed.
Also note that the symlinks
/etc/rc2.d/KXXservice
/etc/rc2.d/SXXservice
 
Search WWH ::




Custom Search