Datasheet

“main” (Installation and Administration) 2004/6/25 13:29 page 271 #297
i
i
i
i
i
i
i
i
11
The SUSE LINUX Boot Concept
rc This script calls the appropriate stop scripts of the current runlevel
and the start scripts of the newly selected runlevel.
11.4.1 Adding init Scripts
You can create your own scripts and easily integrate them into the scheme
described above. For instructions about formatting, naming, and organiz-
ing custom scripts, refer to the specifications of the LSB and to the man
pages of init, init.d/, and insserv. Additionally consult the man
pages of startproc and killproc.
Caution
Creating Your Own init Scripts
Faulty init scripts may freeze your machine. Edit such scripts
with great care and, if possible, subject them to heavy testing in
the multiuser environment. Some useful information about init
scripts can be found in Section 11.2 on page 266.
Caution
To create a custom init script for a given program or service, use the file
/etc/init.d/skeleton as a template. Save a copy of this file under the
new name and edit the relevant program and file names, paths, and other
details as needed. You may also need to enhance the script with your own
parts, so the correct actions are triggered by the init procedure.
The INIT INFO block at the top is a required part of the script and should
be edited. See Example 11.1.
Example 11.1: A Minimal INIT INFO Block
### BEGIN INIT INFO
# Provides: FOO
# Required-Start: $syslog $remote_fs
# Required-Stop: $syslog $remote_fs
# Default-Start: 3 5
# Default-Stop: 0 1 2 6
# Description: Start FOO to allow XY and provide YZ
### END INIT INFO
In the first line of the INFO block, after Provides:, specify the name of the
program or service controlled by this init script. In the Required-Start:
271SUSE LINUX Enterprise Server