如何自动启动 rsyslog?

如何自动启动 rsyslog?

检查 rsyslog 的当前状态

$ chkconfig --list rsyslog
rsyslog                   0:off  1:off  2:off  3:off  4:off  5:off  6:off

在某些级别启动 rsyslog

$ sudo chkconfig --level 35 rsyslog on 

它输出这些信息:

insserv: warning: script 'plymouth-stop' missing LSB tags and overrides
insserv: Default-Start undefined, assuming empty start runlevel(s) for script `plymouth-stop'
insserv: Default-Stop  undefined, assuming empty stop  runlevel(s) for script `plymouth-stop'
The script you are attempting to invoke has been converted to an Upstart
job, but lsb-header is not supported for Upstart jobs.
insserv: warning: script 'failsafe-x' missing LSB tags and overrides
insserv: Default-Start undefined, assuming empty start runlevel(s) for script `failsafe-x'
insserv: Default-Stop  undefined, assuming empty stop  runlevel(s) for script `failsafe-x'
The script you are attempting to invoke has been converted to an Upstart
job, but lsb-header is not supported for Upstart jobs.
insserv: warning: script 'udevtrigger' missing LSB tags and overrides
insserv: Default-Start undefined, assuming empty start runlevel(s) for script `udevtrigger'

再次检查rsyslog的当前状态

$ chkconfig --list rsyslog
rsyslog                   0:off  1:off  2:off  3:off  4:off  5:off  6:off

我是新手。请告诉我如何从头开始使用 rsyslog。

答案1

正如输出所示,脚本已转换为 upstart 作业。因此,目前最好的选择是打开文件/etc/init/rsyslog.conf。您会在那里找到一行start on。将其更改为

start on runlevel [35]

并保存文件。

该命令initctl list显示所有初始化作业的列表并将initctl show-config rsyslog打印出 rsyslog 的状态。

相关内容