linux restart service command

angryTom
Release: 2019-10-24 17:55:52
Original
44600 people have browsed it

linux restart service command

linux restart service command

Restart:

service 服务名 restart
Copy after login

or

systemctl restart 服务名
Copy after login

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
Copy after login

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
Copy after login
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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template