Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Methods of using systemctl commands to manage systemd services

2025-04-05 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

How to use systemctl commands to manage systemd services? This problem may be often seen in our daily study or work. I hope you can gain a lot from this question. The following is the reference content that the editor brings to you, let's take a look at it!

Systemd is the system and service manager of the Linux-based operating system for managing services. Systemd is more powerful and popular than the old Sysvinit.

Most newer versions of Linux-based operating systems (for example: CentOS/Redhat 7, Fedora 25, Ubuntu 16.04) use Systemd as the default service management tool.

Before using the following sample command, you need to use the actual service name (such as httpd, mysql, apache2, or ssh) to change.

Start or stop the service:

Syntax:

$sudo systemctl start .service $sudo systemctl stop .service

Start: used to start stopped services.

Stop: used to stop a running service.

For example:

$sudo systemctl startssh.service$ sudo systemctl stopssh.service

Restart or reload the service:

$sudo systemctl reloadssh.service$ sudo systemctl restartssh.service$ sudo systemctl reload-or-restartssh.service

Reload: used to reload the configuration of running services

Restart: used to restart (Stop/Start) a running service

Reload-or-restart: used to reload service defaults, but if the service cannot be reloaded, it will be restarted

Check the service status:

$sudo systemctl statusssh.service

Status: used to check the current status of the service

Enable or disable the service:

$sudo systemctl enablessh.service$ sudo systemctl disablessh.service

Enable: used to enable the service to start when the system starts

Disable: used to disable services so that they do not start when the system starts

Check the enabled / disabled status of the service:

$sudo systemctl is-activessh.service$ sudo systemctl is-enabledssh.service

Is-active: used to check the current service status of the service

Is-enabled: used to check if the service is enabled when the system starts up

Thank you for reading! After reading the above, do you have a general idea of how to use systemctl commands to manage systemd services? I hope the content of the article will be helpful to all of you. If you want to know more about the relevant articles, you are welcome to follow the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report