要查看syslog服务是否开启,可以使用以下命令:
- 使用systemctl命令检查syslog服务的状态:
systemctl status rsyslog
- 如果syslog服务已经启动,你将看到类似以下输出:
● rsyslog.service - System Logging Service Loaded: loaded (/lib/systemd/system/rsyslog.service; enabled; vendor preset: enabled) Active: active (running) since Tue 2021-01-12 10:10:15 UTC; 5min ago Docs: man:rsyslogd(8) http://www.rsyslog.com/doc/ Main PID: 1234 (rsyslogd) Tasks: 3 (limit: 949) Memory: 2.8M CGroup: /system.slice/rsyslog.service └─1234 /usr/sbin/rsyslogd -n
- 如果syslog服务未启动,你将看到类似以下输出:
● rsyslog.service - System Logging Service Loaded: loaded (/lib/systemd/system/rsyslog.service; enabled; vendor preset: enabled) Active: inactive (dead) Docs: man:rsyslogd(8) http://www.rsyslog.com/doc/
通过以上命令,你可以轻松检查syslog服务的状态。