How to Restart Services in Linux
Start with "ls /etc/init.d"., Switch to the super user (root)., Using the root user, issue the command "service restart"., The service command controls the starting and stopping of services on a Linux system.
Step-by-Step Guide
-
Step 1: Start with "ls /etc/init.d".
This will show you the names of your services, if you're not quite sure of the formal name of the service you're looking for.
The name may not be what you'd expect; Apache is actually httpd, for instance. -
Step 2: Switch to the super user (root).
Do this using the command "su
-" and then responding to the password prompt.
If you use sudo, then you could use the command "sudo
-s" to switch to root, or you could add "sudo" to the front of the following command. , This should restart the service, if the init.d script is complete.
If this doesn't work, try "service <srvcname> stop"
followed by "service <srvcname> start"
which should work for all the services. , The service name can be such things as httpd or mysqld.
Each of these represents a daemon or application which runs on the system and provides some function to you, your users, or the system itself. -
Step 3: Using the root user
-
Step 4: issue the command "service <srvcname> restart".
-
Step 5: The service command controls the starting and stopping of services on a Linux system.
Detailed Guide
This will show you the names of your services, if you're not quite sure of the formal name of the service you're looking for.
The name may not be what you'd expect; Apache is actually httpd, for instance.
Do this using the command "su
-" and then responding to the password prompt.
If you use sudo, then you could use the command "sudo
-s" to switch to root, or you could add "sudo" to the front of the following command. , This should restart the service, if the init.d script is complete.
If this doesn't work, try "service <srvcname> stop"
followed by "service <srvcname> start"
which should work for all the services. , The service name can be such things as httpd or mysqld.
Each of these represents a daemon or application which runs on the system and provides some function to you, your users, or the system itself.
About the Author
Peter Jimenez
Professional writer focused on creating easy-to-follow lifestyle tutorials.
Rate This Guide
How helpful was this guide? Click to rate: