11 February 2008

Manage services under GNU/Linux distributions providing service and chkconfig

A simple refresh of what can be done with service and chkconfig tools.

Get list of all services and their state for each runlevel (including inet and/or xinet if available):
chkconfig --list

Get state for each runlevel of one service (including inet and/or xinet if available):
chkconfig --list serviceName

Remove a service:
chkconfig --del serviceName

Add a service (with state for each runlevel defined automatically according to the service definition file):
chkconfig --add serviceName

Add a service with specific state for some runlevels:
chkconfig --level * serviceName on|off**
* one or several runlevel(s) specified without separator
** only "on" as sense there (to add/activate the service)

Define the state for some runlevels of an installed service:
chkconfig --level * serviceName on|off*
* "on" to "activate" the service, "off" otherwise

Get the current status of all services:
service --status-all

Get the current status of a service:
service serviceName status

Start a service:
service serviceName start

Stop a service:
service serviceName stop

Restart a service:
service serviceName restart

No comments:

Post a Comment

Thank you for your visit, let's share your point of view: