我正在尝试调整系统的启动时间。通常我使用
systemd-analyze blame
它给了我一份清单,上面列出了启动所需的时间。对于这台机器,我不需要其中的大部分,所以这就是
systemctl mask SERVICENAME
或者
systemctl disable SERVICENAME
但是我在 sysvinit 系统上找不到并正在寻找这些命令的替代方案。
答案1
Systemd 命令和 Sysvinit 命令
Systemd Command ------------------------------- Sysvinit Command
systemctl start fooserv ------------------------ service fooserv start
systemctl stop fooserv ------------------------- service fooserv stop
systemctl restart fooserv ---------------------- service fooserv restart
systemctl reload fooserv ----------------------- service fooserv reload
systemctl condrestart fooserv ------------------ service fooserv condrestart
systemctl status fooserv ----------------------- service fooserv status
systemctl list-unit-files --type=service ------- ls /etc/rc.d/init.d/
systemctl enable fooserv ----------------------- chkconfig fooserv on
systemctl disable fooserv ---------------------- chkconfig fooserv off
systemctl is-enabled fooserv ------------------- chkconfig fooserv
systemctl list-unit-files --type=service ------- chkconfig --list
ls /etc/systemd/system/*.wants/fooserv.service - chkconfig fooserv --list
systemctl daemon-reload ------------------------ chkconfig fooserv --add
systemctl isolate multi-user.target ------------ telinit 3
systemctl halt --------------------------------- halt
systemctl poweroff ----------------------------- poweroff
systemctl reboot ------------------------------- reboot
systemctl suspend ------------------------------ pm-suspend
systemctl hibernate ---------------------------- pm-hibernate
journalctl -f ---------------------------------- tail -f /var/log/messages
systemd-analyze
是一个用于检查启动时间的新命令
systemctl mask
是 的增强版本systemctl disable
。这会将这些单元链接到 /dev/null,从而无法启动它们。