2016年4月28日 星期四

Linux 服務管理工具 systemctl

服務的停止與啟動
[root@rhel7 ~]# systemctl start httpd
[root@rhel7 ~]# systemctl stop httpd
[root@rhel7 ~]# systemctl restart httpd
view raw 2016042802.sh hosted with ❤ by GitHub
顯示所有服務
[root@rhel7 ~]# systemctl list-unit-files --type service
UNIT FILE STATE
auditd.service enabled
autovt@.service disabled
avahi-daemon.service enabled
brandbot.service static
console-getty.service disabled
console-shell.service disabled
cpupower.service disabled
crond.service enabled
dbus-org.fedoraproject.FirewallD1.service enabled
view raw 2016042803.sh hosted with ❤ by GitHub
啟動執行與停止服務
[root@rhel7 ~]# systemctl enable httpd
ln -s '/usr/lib/systemd/system/httpd.service' '/etc/systemd/system/multi-user.target.wants/httpd.service'
[root@rhel7 ~]# systemctl disable httpd
rm '/etc/systemd/system/multi-user.target.wants/httpd.service'
view raw 2016042804 hosted with ❤ by GitHub

沒有留言: