RHEL7服务管理

对于学习过红帽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 一 2016-09-12 14:21:12 CST; 32min ago
     Docs: man:sshd(8)
           man:sshd_config(5)
 Main PID: 1642 (sshd)
   CGroup: /system.slice/sshd.service
           └─1642 /usr/sbin/sshd -D

9月 12 14:21:12 localhost.localdomain systemd[1]: Started OpenSSH server dae...
9月 12 14:21:12 localhost.localdomain systemd[1]: Starting OpenSSH server da...
9月 12 14:21:13 localhost.localdomain sshd[1642]: Server listening on 0.0.0....
9月 12 14:21:13 localhost.localdomain sshd[1642]: Server listening on :: por...
9月 12 14:36:49 localhost.localdomain sshd[5238]: Accepted password for root...
Hint: Some lines were ellipsized, use -l to show in full.

例2:

[root@localhost ~]# systemctl is-enabled sshd.service
enabled
原文地址:https://www.cnblogs.com/tdcqma/p/5864778.html