option log-facility not working inside chroot?

Glenn Satchell glenn.satchell at uniq.com.au
Thu Jun 28 15:51:33 UTC 2012


Here's what I think happens:

dhcpd opens the socket to the log device, then opens dhcpd.conf, then 
calls chroot(), then parses dhcpd.conf.

If there is a log-facility() call in dhcpd.conf, then it needs to 
re-open the log device, but now it's in the chroot and can't.

So create a /dev/log inside the chroot and have syslog listen there. I 
think the syslog source piece has a similar effect.

There was another thread on something similar a few weeks back.

regards,
-glenn

On 06/29/12 00:13, Daniel Feuchtinger wrote:
> Solved the problem: in the file
> /var/run/syslog-ng/additional-log-sockets.conf
> the syslog source "chroots" is defined. That works:
> log { source(chroots); filter(f_dhcpd-g1); destination(dhcpdg1); };
>
> I still don't understand, why it works with no "log-facility" option
> in a chroot, but that doesn't matter.
>
> Best regards, Daniel
>
>
>
> Am 28.06.2012 15:30, schrieb Daniel Feuchtinger:
>> Hi all,
>>
>> I try to set up individual log files for some dhcpd processes.
>> That's my syslog-ng filter for testing:
>> filter f_dhcpd-q1   { facility(daemon) and level(emerg..debug); };
>>
>> Everything is working:
>> - if I run dhcpd _not_ in a chroot with the option "log-facility daemon" and
>> - if I run dhcpd in a chroot with no option "log-facility".
>>
>> But if I run dhcpd in a chroot with the option "log-facility daemon",
>> logging is limited (start and stop message only)
>>
>> Isn't daemon the default log facility? It must be, because
>> the syslog filter works without the log-facility option.
>> Why changes something, if I set it, and why only in a chroot?
>>
>> Thanks for your help,
>> Daniel
>>
>
>


More information about the dhcp-users mailing list