ntsysv


The ntsysv utility provides a simple interface for activating or deactivating services. You can use ntsysv to turn an xinetd-managed service on or off. You can also use ntsysv to start or stop a service in the /etc/rc.d hierarchy; in that case, the ntsysv command (without options) is used to configure current runlevel. If you want to configure a different runlevel, use something like ntsysv --levels 016. (In this example, you would be setting the services for runlevels 0, 1, and 6.)

The ntsysv interface works like the text-mode installation program. Use the up and down arrows to navigate up and down the list. The space bar selects/unselects services and is also used to “press” the Ok and Cancel buttons. To move between the list of services and the Ok and Cancel buttons, use the Tab key. An * signifies that a service is set to on. Pressing the F1 key will pop up a short description of each service.

Warning

Changes made with ntsysv do not take effect immediately. You must stop or start the individual service with the command service daemon stop. In the previous example, replace daemon with the name of the service you want to stop — for example, httpd. Replace stop with start or restart to start or restart the service. If you want to start or stop a service that is managed by xinetd, use the command service xinetd restart.

chkconfig

The chkconfig command can also be used to activate and deactivate services. If you use the chkconfig --list command, you will see a list of system services and whether they are started (on) or stopped (off) in runlevels 0 through 6 (at the end of the list, you will see a section for the services managed by xinetd. If you use chkconfig --list to query a service managed by xinetd, you will see whether the xinetd service is enabled (on) or disabled (off). For example, the following command shows that finger is enabled as an xinetd service:

$ chkconfig --list finger finger               on

As shown above, if xinetd is running, finger is enabled. If you use chkconfig --list to query a service in /etc/rc.d, you will see the service’s settings for each runlevel, as in the following example:

$ chkconfig --list anacron anacron    0:off   1:off   2:on   3:on   4:on   5:on   6:off

More important, chkconfig can be used to set a service to be started (or not) in a specific runlevel. For example, to turn nscd off in runlevels 3, 4, and 5, use the command

chkconfig --level 345 nscd off

See the chkconfig man page for more information on how to use it.

Warning

Services managed by xinetd are immediately affected by chkconfig. For example, if xinetd is running, finger is disabled, and the command chkconfig finger on is executed, finger is immediately enabled without your having to restart xinetd manually. Changes for other services do not take effect immediately after using chkconfig. You must stop or start the individual service with the command service daemon stop. In the previous example, replace daemon with the name of the service you want to stop — for example, httpd. Replace stop with start or restart to start or restart the service.




Official Red Hat Linux Administrator's Guide
Official Red Hat Linux Administrators Guide
ISBN: 0764516957
EAN: 2147483647
Year: 2002
Pages: 278
Authors: Red Hat Inc

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net