Skip to content

Commit 5ed940c

Browse files
committed
SysVinit与Systemd比较
1 parent 35fb367 commit 5ed940c

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

Linux.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -594,3 +594,25 @@ sudo apt-get install shadowsocks-qt5
594594
$ curl ifconfig.me
595595
101.231.185.66
596596
```
597+
598+
599+
SysVinit to Systemd Cheatsheet/zh
600+
601+
https://fedoraproject.org/wiki/SysVinit_to_Systemd_Cheatsheet/zh
602+
603+
Sysvinit 命令 | Systemd 命令 | 备注
604+
--- | --- | ---
605+
service frobozz start | systemctl start frobozz.service | 用来启动一个服务 (并不会重启现有的)
606+
service frobozz stop | systemctl stop frobozz.service | 用来停止一个服务 (并不会重启现有的)。
607+
service frobozz restart | systemctl restart frobozz.service | 用来停止并启动一个服务。
608+
service frobozz reload | systemctl reload frobozz.service | 当支持时,重新装载配置文件而不中断等待操作。
609+
service frobozz condrestart | systemctl condrestart frobozz.service | 如果服务正在运行那么重启它。
610+
service frobozz status | systemctl status frobozz.service | 汇报服务是否正在运行。
611+
ls /etc/rc.d/init.d/ | systemctl list-unit-files --type=service (推荐) ls /lib/systemd/system/*.service /etc/systemd/system/*.service | 用来列出可以启动或停止的服务列表。
612+
chkconfig frobozz on | systemctl enable frobozz.service | 在下次启动时或满足其他触发条件时设置服务为启用
613+
chkconfig frobozz off | systemctl disable frobozz.service | 在下次启动时或满足其他触发条件时设置服务为禁用
614+
chkconfig frobozz | systemctl is-enabled frobozz.service | 用来检查一个服务在当前环境下被配置为启用还是禁用。
615+
chkconfig --list | systemctl list-unit-files --type=service (推荐) ls /etc/systemd/system/*.wants/ | 输出在各个运行级别下服务的启用和禁用情况
616+
chkconfig frobozz --list | ls /etc/systemd/system/*.wants/frobozz.service | 用来列出该服务在哪些运行级别下启用和禁用。
617+
chkconfig frobozz --add | systemctl daemon-reload | 当您创建新服务文件或者变更设置时使用。
618+

0 commit comments

Comments
 (0)