Puppet Master 日志未在配置的位置创建

Puppet Master 日志未在配置的位置创建

下面是我的 puppet master puppet.conf 文件

[main]
logdir=/var/log/puppet
vardir=/var/lib/puppet
ssldir=/var/lib/puppet/ssl
rundir=/var/run/puppet
factpath=$vardir/lib/facter
certname = puppet
dns_alt_names = puppet

[master]
# These are needed when the puppetmaster is run by passenger
# and can safely be removed if webrick is used.
ssl_client_header = SSL_CLIENT_S_DN
ssl_client_verify_header = SSL_CLIENT_VERIFY

虽然我在配置中指定了 logdir /var/log/puppet,但 puppet master 日志是在/var/log/syslog

有什么解决办法吗?

答案1

您可以通过编辑以下内容自定义主日志目标:

  • /etc/default/puppet(Ubuntu 12.04 LTS)
  • 编辑/etc/init.d/puppet(Ubuntu 14.04 LTS)

添加以下内容DAEMON_OPTS

DAEMON_OPTS="--logdest=/var/log/puppet/master.log"

答案2

在 syslog 守护进程中设置日志记录应该很简单。我使用的配置如下。确保在进行更改后重新启动 ryslog。

/etc/rsyslog.d/40-puppet.conf

# PUPPETHEADER: This file is owned by Puppet.

if $programname == 'puppet-agent' then -/var/log/puppet/puppet.log
& ~

if $programname == 'puppet-master' then -/var/log/puppet/puppetmaster.log
& ~

相关内容