使用 systemctl 命令查看所有开机自启的服务:
systemctl list-unit-files --type=service --state=enabled UNIT FILE STATE auditd.service enabled [email protected] enabled buildkit.service enabled chronyd.service enabled containerd.service enabled crond.service enabled dbus-org.freedesktop.NetworkManager.service enabled dbus-org.freedesktop.nm-dispatcher.service enabled docker.service enabled [email protected] enabled irqbalance.service enabled kdump.service enabled lvm2-monitor.service enabled microcode.service enabled NetworkManager-dispatcher.service enabled NetworkManager-wait-online.service enabled NetworkManager.service enabled postfix.service enabled rhel-autorelabel-mark.service enabled rhel-autorelabel.service enabled rhel-configure.service enabled rhel-dmesg.service enabled rhel-domainname.service enabled rhel-import-state.service enabled rhel-loadmodules.service enabled rhel-readonly.service enabled rsyslog.service enabled sshd.service enabled systemd-readahead-collect.service enabled systemd-readahead-drop.service enabled systemd-readahead-replay.service enabled tuned.service enabled这将显示所有已启用的服务以及其开机自启状态。 如果只想查看特定服务的开机自启状态,可以使用以下命令:
systemctl is-enabled <service-name> 将<service-name>替换为要查询的服务的名称
[root@test ~]# systemctl is-enabled docker enabled该命令将显示特定服务的开机自启状态,如果该服务已开启自启将返回 "enabled"。 标签:Systemd,service,systemctl,enabled,开启,自启,rhel,NetworkManager From: https://www.cnblogs.com/qianyuliang/p/17634094.html