要查看syslog服務是否開啟,可以使用以下命令:
systemctl status rsyslog
● 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
● 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服務的狀態。