
below). Also, where xinetd is used, it can control those services as well. chkconfig can tell us what services
the system is configured to run, but not necessarily all services that are indeed actually running. Or what
services may be started by other means, e.g. from rc.local. It is a configuration tool, more than a real time
system auditing too.
Skeptical that we are going to break your system, and the pieces won't go back together again? If so, take this
approach: turn off everything listed above in "The Danger Zone", and run your system for a while. OK? Try
stopping one of the ones we found to be "unnecessary" above. Then, run the system for a while. Keep
repeating this process, until you get to the bare minimum. If this works, then make the changes permanent
(see below).
The ultimate objective is not just to stop the service now, but to make sure it is stopped permanently! So
whatever steps you take here, be sure to check after your next reboot.
There are various places and ways to start system services. Let's look at the most common ways this is done,
and is probably how your system works. System services are typically either started by "init" scripts, or by
inetd (or its replacement xinetd) on most distributions.
3.3.1. Stopping Init Services
Init services are typically started automatically during the boot process, or during a runlevel change. There is
a naming scheme that uses symlinks to determine which services are to be started, or stopped, at any given
runlevel. The scripts themselves should be in /etc/init.d/ (or possibly /etc/rc.d/init.d/ for
older versions of Red Hat).
You can get a listing of these scripts:
# ls −l /etc/rc.d/init.d/ | less
To stop a running service now, as root:
# /etc/init.d/<$SERVICE_NAME> stop
Where "$SERVICE_NAME" is the name of the init script, which is often, but not always, the same as the
service name itself. Older Red Hat versions may use the path /etc/rc.d/init.d/ instead.
This only stops this particular service now. It will restart again on the next reboot, or runlevel change, unless
additional steps are taken. So this is really a two step process for init type services.
chkconfig can be used to see what services are started at each runlevel, and to turn off any unneeded services.
To view all services under its control, type this command in an xterm:
# chkconfig −−list | less
Security Quick−Start HOWTO for Red Hat Linux
3.3.1. Stopping Init Services 10
Commenti su questo manuale