searchusermenu
  • 发布文章
  • 消息中心
点赞
收藏
评论
分享
原创

systemctl常用命令

2024-09-05 09:26:38
6
0

systemctl操作
启动
systemctl start xxx
systemctl stop xxx
systemctl restart xxx
查看状态
systemctl status xxx
设置自启动
systemctl enable xxx
systemctl disable xxx
修改了unit之后
# 如/usr/lib/systemd/system、/etc/systemd/system中xxx.service,xxx.service.d的东西
systemctl daemon-reload
查看开机项
systemctl list-unit-files  (查看开机启动项)
systemctl list-unit-files  |  grep 程序名称   (查看某些服务开机启动状态)
systemctl list-unit-files |  grep enable (查看哪些为开机启动服务)
从失败的列表中删除unit
systemctl stop [servicename]
systemctl disable [servicename]
要重置所有状态为失败的unit:
systemctl reset-failed
或指定特定unit:
systemctl reset-failed xxx.service
CentOS修改了系统启动文件后执行systemctl daemon-reload报错 

Error getting authority: Error initializing authority: Error calling StartServiceByName for org.freedesktop.PolicyKit1: Timeout was reached (g-io-error-quark, 24)


[bin]$ systemctl daemon-reload

** (pkttyagent:31514): WARNING **: Unable to register authentication agent: Timeout was reached
Error registering authentication agent: Timeout was reached (g-io-error-quark, 24)
Failed to execute operation: Connection timed out
解决办法安装polkit,再重载即可

yum -y install polkit

0条评论
作者已关闭评论
zzzzgj
9文章数
1粉丝数
zzzzgj
9 文章 | 1 粉丝
原创

systemctl常用命令

2024-09-05 09:26:38
6
0

systemctl操作
启动
systemctl start xxx
systemctl stop xxx
systemctl restart xxx
查看状态
systemctl status xxx
设置自启动
systemctl enable xxx
systemctl disable xxx
修改了unit之后
# 如/usr/lib/systemd/system、/etc/systemd/system中xxx.service,xxx.service.d的东西
systemctl daemon-reload
查看开机项
systemctl list-unit-files  (查看开机启动项)
systemctl list-unit-files  |  grep 程序名称   (查看某些服务开机启动状态)
systemctl list-unit-files |  grep enable (查看哪些为开机启动服务)
从失败的列表中删除unit
systemctl stop [servicename]
systemctl disable [servicename]
要重置所有状态为失败的unit:
systemctl reset-failed
或指定特定unit:
systemctl reset-failed xxx.service
CentOS修改了系统启动文件后执行systemctl daemon-reload报错 

Error getting authority: Error initializing authority: Error calling StartServiceByName for org.freedesktop.PolicyKit1: Timeout was reached (g-io-error-quark, 24)


[bin]$ systemctl daemon-reload

** (pkttyagent:31514): WARNING **: Unable to register authentication agent: Timeout was reached
Error registering authentication agent: Timeout was reached (g-io-error-quark, 24)
Failed to execute operation: Connection timed out
解决办法安装polkit,再重载即可

yum -y install polkit

文章来自个人专栏
zzz
9 文章 | 1 订阅
0条评论
作者已关闭评论
作者已关闭评论
0
0