How To Restart The Daemon

Table of contents:

How To Restart The Daemon
How To Restart The Daemon

Video: How To Restart The Daemon

Video: How To Restart The Daemon
Video: start, stop, restart Linux services (daemon HUNTING!!) // Linux for Hackers // EP 6 2024, November
Anonim

In UNIX-like operating systems, processes that perform service functions and do not have a user interface are called daemons. A large number of utility software is implemented in the form of daemons (task scheduler, logging subsystem, DBMS servers, etc.). Sometimes a particular daemon needs to be restarted.

How to restart the daemon
How to restart the daemon

Necessary

  • - access to the target machine (physical or remote);
  • - root credentials.

Instructions

Step 1

Log in to the target machine with root user credentials. If you have physical access to your computer and are working in a graphical environment (KDE, Gnome, etc.), start a terminal emulator such as XTerm or Konsole. You can also switch to the text console by pressing the Ctrl + Alt + Fx key combination, where x is the console number. If you are already logged in as a user other than root, run the su command. If you have SSH access to the machine, use a suitable program to connect. On UNIX-like systems, the ssh console client is usually installed. When working under Windows, you can use the PuTTY program, which is freely distributed on the putty.nl website. Enter root credentials and start a session.

How to restart the daemon
How to restart the daemon

Step 2

Find out the name of the init script corresponding to the daemon that needs to be restarted. Typically, all such scripts are located in the /etc/rc.d/init.d directory and have the same names as the daemons they serve. View the contents of this directory using the file manager or the ls command. If you know the approximate name of the daemon, filter the ls output with grep. For example, ls -1 /etc/rc.d/init.d | grep log

How to restart the daemon
How to restart the daemon

Step 3

Find out about the current state of the daemon being restarted. Execute a command of the form: service status Here, instead of a marker, use the name obtained in the previous step. If a line like is running is displayed, the daemon is running and can be restarted. Otherwise it is not possible (such a demon does not exist or is stopped).

How to restart the daemon
How to restart the daemon

Step 4

Restart the daemon. Run a command of the form: service The value is similar to that described in the third step. As a parameter, use one of the well-known identifiers of the daemon commands leading to restart (they are usually described in the documentation supplied with the corresponding package) or the --full-restart option. For example: service syslogd restartservice httpd2 gracefulservice syslogd --full-restart

How to restart the daemon
How to restart the daemon

Step 5

End the current session. Enter the command exit. Hit Enter. You can also use the logout command to shut down the text console or disconnect from the SSH server.

Recommended: