systemd管理服务简单整理

sysvinit 命令systemd 命令备注
service frobozz startsystemctl start frobozz.service用来启动一个服务 (并不会重启现有的)
service frobozz stopsystemctl stop frobozz.service用来停止一个服务 (并不会重启现有的)。
service frobozz restartsystemctl restart frobozz.service用来停止并启动一个服务。
service frobozz reloadsystemctl reload frobozz.service当支持时,重新装载配置文件而不中断等待操作。
service frobozz condrestartsystemctl condrestart frobozz.service如果服务正在运行那么重启它。
service frobozz statussystemctl status frobozz.service汇报服务是否正在运行。
ls /etc/rc.d/init.d/ls /lib/systemd/system/*.service /etc/systemd/system/*.service用来列出可以启动或停止的服务列表。
chkconfig frobozz onsystemctl enable frobozz.service在下次启动时或满足其他触发条件时设置服务为启用
chkconfig frobozz offsystemctl disable frobozz.service在下次启动时或满足其他触发条件时设置服务为禁用
chkconfig frobozzsystemctl is-enabled frobozz.service用来检查一个服务在当前环境下被配置为启用还是禁用。
chkconfig frobozz --listls /etc/systemd/system/*.wants/frobozz.service用来列出该服务在哪些运行级别下启用和禁用。
chkconfig frobozz --add 不需要,没有等效命令。

 

设置默认启动【字符界面】

systemctl set-default multi-user.target

设置默认启动【图形界面】

systemctl set-default graphical.target

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值