Thursday, June 24, 2010

Control Linux Services in command line

Linux OS also runs several services like windows. Some times most of them are not useful or sometimes some of them are reduce PC performance. So how to manage those service in Linux. Here i show the basic way to control those service through the command line in fedora.

The syntax is - service [service name] [option]

The available options are
--start - Start the stopped services
--stop - Stop currently running services
--restart - Restart a service
--status - Check status of a service

Here are some example to show how it works

I want to check and stop the service of Network Manager. So first i want to check the status of the Network Manager. Issue following command as a root.
[root@fedora fedora 11]# service NetworkManager status
NetworkManager(pid 5054) is running ...
[root@fedora fedora 11]#

Ok now the service is running. So now i am going to stop the service.
[root@fedora fedora 11]# service NetworkManager start
Starting NetworkManager daemon: [OK]
[root@fedora fedora 11]#

To check all services issue services --status-all
To get help services --help





No comments:

Post a Comment