Home >Operation and Maintenance >Linux Operation and Maintenance >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 defaultsThe 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
, 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 redis2) 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.
The above is the detailed content of linux restart service command. For more information, please follow other related articles on the PHP Chinese website!