示例:
apt install apache2
systemctl status apache2
cat /lib/systemd/system/apache2.service apache2 服务启动文件
systemctl start apache2
ps aux | grep apache2
ps aux 查看进程
systemctl stop apache2
systemctl restart apache2
systemctl enable apache2
开机自启动
/etc/systemd/system/multi-user.target.wants/apache2.service enable 其实是是建立 apache2 服
务软链接
systemctl disable apache2
取消开机自启动
systemctl mask apache2
屏蔽服务,永远不能启动
systemctl unmask apache2
取消屏蔽
https://xpanx.com/
评论