Advertisement
Tritonio

Restarting sysvinit services

May 1st, 2020
151
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.56 KB | None | 0 0
  1. init is a program for Linux an Unix-based systems to spawns all other processes. It runs as a daemon and has PID 1. The boot loader starts the kernel and the kernel starts init. A Linux or Unix based system can be started up into various runlevels. The /etc/init.d/ directory stores various shell scripts which can be used for:
  2.  
  3. Load kernel drivers ( modules ).
  4. Check and mount file systems.
  5. Setup network.
  6. Mount remote file systems (such as nfs).
  7. Start web server and other services.
  8. You can use the following syntax to control various services:
  9. # /etc/init.d/NAME start|stop|restart|status|reload|condrestart
  10.  
  11. OR
  12. # /sbin/services NAME start|stop|restart|status|reload|condrestart
  13.  
  14. Where,
  15.  
  16. start : Start a service (such as Apache by typing ‘service httpd start’)
  17. stop : Stop a service (such as Apache by typing ‘service httpd stop’).
  18. restart : Restart (stop and then start) a service (such as Apache by typing ‘service httpd restart’) .
  19. status : Find out whether a service is currently running or not (such as Apache by typing ‘service httpd status’) .
  20. reload : Reloads the config file without interrupting pending operations(reload Apache web server after the config file changes using ‘service httpd reload’) .
  21. condrestart : Restarts if the service is already running (such as Apache by typing ‘service httpd condrestart).
  22. Service command is used to run a System V init script. Usually all system V init scripts are stored in /etc/init.d directory and service command can be used to start, stop, and restart the daemons and other services under Linux.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement