


How to use systemctl command to manage systemd service
This article will introduce how to use the systemctl command to manage systemd services. Systemd is a system and service manager for Linux-based operating systems used to manage 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 example command, you need to change the
Start or stop a service:
Syntax:
$ sudo systemctl start <service name> .service $ sudo systemctl stop <service name>.service
start: Used to start a stopped service.
stop: Used to stop running services.
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: Configuration for reloading the running service
Restart: Used to restart (Stop/Start) a running service
reload-or-restart: Used to reload the service default value, but if the service cannot be reloaded, it will Restart it
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 the service to not start when the system starts
Check the service The enabled/disabled status:
$ 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 whether the service is enabled when the system starts
This article has ended here. For more exciting content, you can pay attention to the Linux Tutorial Video column on the PHP Chinese website!
The above is the detailed content of How to use systemctl command to manage systemd service. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics



How to use Systemd and Crontab to implement parallel execution of tasks in a Linux system. In a Linux system, parallel execution of tasks is one of the important means to improve system efficiency and performance. This article will introduce how to use Systemd and Crontab tools to implement parallel execution of tasks in a Linux system, and provide specific code examples. 1. Introduction to Systemd Systemd is a tool used to manage the startup process and service management of Linux systems. via configuration

Main features of MySQL 5.7: Native support for Systemd Better performance: Better optimization for multi-core CPUs, solid-state drives, and locks Better InnoDB storage engine More robust replication function: Replication brings no data loss at all , traditional financial customers can also choose to use the MySQL database. In addition, GTID online smooth upgrade also becomes possible with a better optimizer: the significance of optimizer code reconstruction will bring huge improvements in this version and subsequent versions, Oracle officials are solving the biggest problem before MySQL native JSON type Support better geographical information service support: InnoDB natively supports geographical location type, supports GeoJSON, GeoHash special

How to use Systemd and Crontab to automatically restart applications in Linux systems. In Linux systems, Systemd and Crontab are two very important tools. Systemd is a system and service manager, while Crontab is a tool for automating tasks at specified times. This article will use a specific example to introduce how to use Systemd and Crontab to automatically restart applications in Linux systems. Suppose we have a No

How to use Systemd and Crontab to set the priority of scheduled tasks in a Linux system requires specific code examples. In Linux systems, we often need to set up scheduled tasks to perform some repetitive operations, such as scheduled backup files, regular log cleaning, etc. However, different tasks may have different priorities, some tasks require higher priority to ensure they are executed on time, while some tasks can be executed later. This article will introduce how to use Systemd and Crontab to set timings

How to use Systemd and Crontab to implement system self-starting in Linux systems Introduction: In Linux systems, we often need to set some commonly used services or scripts to system self-starting so that they can run automatically after the system restarts. In this article, we will introduce how to use the two tools Systemd and Crontab to realize system self-starting, and give specific code examples. 1. The use of Systemd Systemd is a commonly used system and service management in Linux operating systems.

How to use Systemd and Crontab to implement task dependencies in Linux systems Introduction: In Linux systems, task scheduling is a very important part, which can ensure that each task is executed according to the scheduled time and order. Systemd and Crontab are two commonly used task scheduling tools, and they are suitable for different scenarios. This article will introduce how to use Systemd and Crontab to implement task dependencies and provide specific code examples. 1. Systemd

LinuxSystemdCrontab Getting Started Tutorial: From Basics to Advanced Introduction: In Linux systems, we often need to perform certain tasks regularly, such as backing up data, cleaning up temporary files, etc. In order to automate the execution of these tasks, we can use Crontab to create and manage scheduled tasks. In the latest Linux distributions, Systemd has become a mainstream system initialization and management tool. This article will introduce how to use Systemd's Crontab to achieve

Overview of how to automate server monitoring in Linux systems through Systemd and Crontab In server management, monitoring is a very important link. By monitoring the status and performance of the server, problems can be discovered in time and corresponding measures can be taken for optimization and repair. This article will introduce how to use Systemd and Crontab tools to automate server monitoring and provide specific code examples. SystemdSystemd is a Linux system initialization system and service
