对于学习过红帽RHEL6的系统或已经习惯使用service、chkconfig等命令来管理系统服务的用户可能要郁闷了,
因为在红帽RHEL7系统中管理服务的命令变成了“systemctl”,但使用方法大致相同,做一下对比。
例1:
[root@localhost ~]# systemctl status sshd.service
● sshd.service - OpenSSH server daemon
Loaded: loaded (/usr/lib/systemd/system/sshd.service; enabled; vendor preset: enabled)
Active: active (running) since 一 -- :: CST; 32min ago
Docs: man:sshd()
man:sshd_config()
Main PID: (sshd)
CGroup: /system.slice/sshd.service
└─ /usr/sbin/sshd -D 9月 :: localhost.localdomain systemd[]: Started OpenSSH server dae...
9月 :: localhost.localdomain systemd[]: Starting OpenSSH server da...
9月 :: localhost.localdomain sshd[]: Server listening on 0.0.....
9月 :: localhost.localdomain sshd[]: Server listening on :: por...
9月 :: localhost.localdomain sshd[]: Accepted password for root...
Hint: Some lines were ellipsized, use -l to show in full.
例2:
[root@localhost ~]# systemctl is-enabled sshd.service
enabled