Systemctl Services in RHEL 7

                                        Systemd is a system and service manager for Linux operating systems. It is designed to be backwards compatible with SysV init scripts, and provides a number of features such as parallel startup of system services at boot time, on-demand activation of daemons, support for system state snapshots, or dependency-based service control logic. In Red Hat Enterprise Linux 7, systemd replaces Upstart as the default init system.

1) To Start a Service:  

# systemctl start httpd.service

2) To Stop a Service:

# systemctl stop httpd.service

3) To Restart a Service:

# systemctl restart httpd.service

4) To check for the Status :

  # systemctl status httpd.service

5) To Restart the Service only if it is running:

# systemctl try-restart httpd.service
# systemctl reload httpd.service

NOTE:   The System service doesn’t support this feature. For convenience, the systemctl command also supports the reload-to-restart and reload-to-try-restart commands that restarts such services instead.

6) To Check if the Service is active or in-active:

# systemctl is-active httpd.service

7) To Display the status of all Services: 

# systemctl list-units –type service –all

8)  To Enable the Service:   

  # systemctl enable httpd.service

8.1) To re-create the symbolic-links while re-enabling the service unit.

# systemctl reenable httpd.service

9) To Disable a Service:  

# systemctl disable httpd.service

9.1) To prevent the service being started manually or by any other service, you can make use of the mask

  # systemctl mask httpd.service

      9.2) To Revert this option and unmask the service unit:     

# systemctl unmask httpd.service

10) To List all Services and check if they are enabled:  

# systemctl list-unit-files –type service

11) To List Services that are ordered to start before the specified unit.

# systemctl list-dependencies –after

12) To List Services that are odered to to start after the specified unit. 

# systemctl list-dependencies –before

13) To List all currently loaded Service Units.

# systemctl list-units –type service  

14) By default the systemctl list-units will display only the active units. If you want to list all the loaded untis regardless of their state.

# systemctl list-units –type service –all 


15) To List all the Available Service Units :

# systemctl list-unit-files –type service







You may also like...

Leave a Reply