Linux开机启动管理---systemd使用
发布日期:2021-07-01 01:01:29 浏览次数:2 分类:技术文章

本文共 706 字,大约阅读时间需要 2 分钟。

常用命令

使某服务自动启动

systemctl enable httpd.service

1
使某服务不自动启动

systemctl disable httpd.service

1
检查服务状态

systemctl status httpd.service (服务详细信息) 

systemctl is-active httpd.service (仅显示是否 Active)
1
2
显示所有已启动的服务

systemctl list-units --type=service

1
启动某服务

systemctl start httpd.service

1
停止某服务

systemctl stop httpd.service

1
重启某服务

systemctl restart httpd.service

1
修改配置文件后重启
修改配置文件以后,需要重新加载配置文件,然后重新启动相关服务。

# 重新加载配置文件

$ sudo systemctl daemon-reload

# 重启相关服务

$ sudo systemctl restart foobar
开机服务管理
开机启动unit

systemctl enable test.service

增加由/lib/systemd/system/到/etc/systemd/system/multi-user.target.wants/下的软链接
ln -s '/usr/lib/systemd/system/postfix.service' '/etc/systemd/system/multi-user.target.wants/test.service'

转载地址:https://mao0514.blog.csdn.net/article/details/115581124 如侵犯您的版权,请留言回复原文章的地址,我们会给您删除此文章,给您带来不便请您谅解!

上一篇:arm linux rc.local systemd设置开机启动
下一篇:armlinux开发板用户自动登录

发表评论

最新留言

路过,博主的博客真漂亮。。
[***.116.15.85]2024年04月17日 23时17分16秒