Home  >  Article  >  Operation and Maintenance  >  linux restart service command

linux restart service command

angryTom
angryTomOriginal
2019-10-21 17:02:5344514browse

linux restart service command

linux restart service command

Restart:

service 服务名 restart

or

systemctl restart 服务名

service and systemctl

##1.service command

service command actually Go to the

/etc/init.d directory to execute the relevant program

# service命令启动redis脚本
service redis start
# 直接启动redis脚本
/etc/init.d/redis start
# 开机自启动
update-rc.d redis defaults

The script needs to be written by ourselves

2.systemctl commandsystemd is the latest initialization system (init) of the Linux system. Its function is to improve the startup speed of the system, start as few processes as possible, and start as many processes concurrently as possible. The process management command corresponding to systemd is systemctl

1) The systemctl command is compatible with service

, that is, systemctl will also go to the /etc/init.d directory to view and execute related programs

systemctl redis startsy
stemctl redis stop
# 开机自启动systemctl enable redis

2) The systemctl command manages systemd’s resource Unit

systemd’s Unit is placed in the directory /usr/lib/systemd/system (Centos) or /etc/systemd/system (Ubuntu). There are mainly four types of files. mount,. service,.target,.wants.

Recommended:

[Linux video tutorial]

The above is the detailed content of linux restart service command. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn