
This is the Title of the Book, eMatter Edition
Copyright © 2007 O’Reilly & Associates, Inc. All rights reserved.
50
|
Chapter 3: Hardening Linux and Using iptables
To list all the startup services on my Red Hat system, I simply enter chkconfig --list.
For each script in /etc/rc.d, chkconfig lists that script’s startup status (on or off) at each
runlevel. The output of Example 3-3 has been truncated for readability.
To disable isdn in runlevel 2, I’d execute the commands shown in Example 3-4.
(The second command,
chkconfig --list isdn, is optional but useful in showing the
results of the first.) To remove isdn’s startup script from all runlevels, I’d use the
command:
chkconfig -–del isdn
Disabling services in SUSE
SUSE Linux introduced a syntax-compatible version of chkconfig in SUSE 8.1 (it’s
actually a frontend to its own insserv command) but still uses its own format for init
scripts (Example 3-5).
Example 3-2. chkconfig usage message
[mick@woofgang mick]# chkconfig --help
chkconfig version 1.2.16 - Copyright (C) 1997-2000 Red Hat, Inc.
This may be freely redistributed under the terms of the GNU Public License.
usage: chkconfig --list [name]
chkconfig --add <name>
chkconfig --del <name>
chkconfig [--level <levels>] <name> <on|off|reset>)
Example 3-3. Listing all startup scripts’ configuration
[root@woofgang root]# chkconfig --list
nfs 0:off 1:off 2:off 3:off 4:off 5:off 6:off
microcode_ctl 0:off 1:off ...