Issue #9258 has been updated by Josh Cooper.
Status changed from In Topic Branch Pending Review to Code Insufficient
I modified Puppet::Network::HTTP::Rack.initialize with the proposed fix and
some debugging:
<pre>
Puppet::Util::Log.destinations.each {|d| puts d.inspect }
Puppet::Util::Log.reopen
Puppet::Util::Log.destinations.each {|d| puts d.inspect }
</pre>
with this config:
<pre>
[main]
syslogfacility=DEBUG
</pre>
and reopening the logs does not cause the correct facility to be used (note how
facility is unchanged):
`[:syslog, #<Puppet::Util::Log::DestSyslog:0x1024e2cf0 @syslog=<#Syslog:
opened=true, ident="puppet-master", options=9, facility=24, mask=255>>]`
`[:syslog, #<Puppet::Util::Log::DestSyslog:0x1021168b0 @syslog=<#Syslog:
opened=true, ident="puppet-master", options=9, facility=24, mask=255>>]`
After more research it turns out, when running under rack, puppet does not
apply any settings under [main]. So it's not just syslog, but others like path,
rundir, etc. As a result, the proposed fix is not sufficient for me (circa
2.7.8rc1)
Also I discovered that the daemonize code Puppet::Network::Server is never
called. It appears to be dead code.
----------------------------------------
Bug #9258: Puppet Master as Rack application ignores (at least) syslogfacility
https://projects.puppetlabs.com/issues/9258
Author: Ronald van Zantvoort
Status: Code Insufficient
Priority: Normal
Assignee: James Turnbull
Category: logging
Target version:
Affected Puppet version: 2.7.3
Keywords: syslogfacility rack passenger
Branch:
https://github.com/jamtur01/puppet/commit/7e79e07572a436fdb9d172d904410dc7c2954467
Attempting to define a syslogfacility in the config file (under `[main]` or
`[master]`, makes no difference) or in `ARGV` in `rack/config.ru` when running
Puppet as Rack app through Passenger will not apply the setting, and it will
stubbornly log with the default settings to syslog.
This can be traced back to the fact that both `daemon.rb` and
`network/server.rb` (during `daemonize`) call `Puppet::Util::Log.reopen`, but
when using Rack, `network/http/rack.rb` will be used, which never does.
**DISCLAIMER: I ain't no Ruby dev!**
So in my case, this is quite possibly an unacceptable ugly hack, I dunno ;-), I
simply patched `network/http/rack.rb`:
<pre>
def initialize(args)
+ Puppet::Util::Log.reopen
raise ArgumentError, ":protocols must be specified." if !args[:protocols]
or args[:protocols].empty?
protocols = args[:protocols]
</pre>
and it started responding to the config option.
--
You have received this notification because you have either subscribed to it,
or are involved in it.
To change your notification preferences, please click here:
http://projects.puppetlabs.com/my/account
--
You received this message because you are subscribed to the Google Groups
"Puppet Bugs" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/puppet-bugs?hl=en.