1 |
Well, I'm starting to make progress. But something isn't right. I found |
2 |
out the plugin error was due to the fact that despite syslog-ng.com |
3 |
showing the reversal as NOT, the actual statement is not (all lower case |
4 |
vs all upper case). So that means that syslog-ng loads just fine. But I |
5 |
can't get the dhcp output to where I want it. If I have the syslog |
6 |
facility in dhcpd turned on, or if I redirect the output to a file in |
7 |
systemd, then I get dhcpd messages in the file AND in the syslog itself |
8 |
(/var/log/messages). No matter what I try, the dhcpd output ALWAYS goes |
9 |
to syslog. I can get it to go to a separate file TOO, but not ONLY. |
10 |
Here's the entire syslog-ng.conf and the service file for dhcpd. |
11 |
Hopefully you guys can figure something out I missed: |
12 |
|
13 |
|
14 |
(dhcpd4.service) |
15 |
[Unit] |
16 |
Description=DHCPv4 Server Daemon |
17 |
Documentation=man:dhcpd(8) man:dhcpd.conf(5) |
18 |
After=network.target |
19 |
After=time-sync.target |
20 |
After=network-online.target |
21 |
Wants=network-online.target |
22 |
StandardOut=null |
23 |
StandardError=null |
24 |
|
25 |
[Service] |
26 |
ExecStart=/usr/sbin/dhcpd -f -cf /etc/dhcp/dhcpd.conf -user dhcp -group |
27 |
dhcp --no-pid |
28 |
|
29 |
[Install] |
30 |
WantedBy=multi-user.target |
31 |
|
32 |
|
33 |
With everyhing going to null, you'd think that with the syslog statement |
34 |
in dhcpd.conf disabled, I'd get no log at all. But I still get the log |
35 |
in /var/log/messages. Here's syslog-ng.conf: |
36 |
@version: 3.26 |
37 |
|
38 |
options { |
39 |
threaded(yes); |
40 |
chain_hostnames(no); |
41 |
stats_freq(43200); |
42 |
mark_freq(3600); |
43 |
}; |
44 |
filter dhcpfilter { facility(local7); }; |
45 |
filter nondhcp { not filter(dhcpfilter); }; |
46 |
source src { system(); internal(); }; |
47 |
destination messages { file("/var/log/messages"); }; |
48 |
destination dhcplog { file("/var/log/dhcpd.log"); }; |
49 |
destination console_all { file("/dev/tty12"); }; |
50 |
log { source(src); filter(nondhcp); destination(messages); }; |
51 |
log { source(src); destination(console_all); }; |
52 |
log { source(src); filter(dhcpfilter); destination(dhcplog); }; |
53 |
|
54 |
|
55 |
And for what it's worth, here's my dhcpd.conf: |
56 |
default-lease-time 3600; |
57 |
max-lease-time 43200; |
58 |
|
59 |
# Use this to enble / disable dynamic dns updates globally. |
60 |
ddns-update-style interim; |
61 |
|
62 |
authoritative; |
63 |
|
64 |
# log-facility local7; |
65 |
|
66 |
|
67 |
allow booting; |
68 |
|
69 |
subnet 10.0.2.0 netmask 255.255.255.0 { |
70 |
# no services at all! |
71 |
} |
72 |
|
73 |
subnet 192.168.10.0 netmask 255.255.255.0 { |
74 |
range 192.168.10.128 192.168.10.254; |
75 |
if exists user-class and option user-class = "iPXE" { |
76 |
filename "pxelinux.efi"; |
77 |
} else { |
78 |
filename "pxelinux.0"; |
79 |
} |
80 |
next-server 192.168.10.3; |
81 |
option domain-name-servers 192.168.10.2, 8.8.8.8; |
82 |
option domain-name "eglifamily.name"; |
83 |
option routers 192.168.10.1; |
84 |
} |
85 |
|
86 |
host testbox-1 { |
87 |
hardware ethernet 08:00:27:D5:AA:3C; |
88 |
fixed-address 192.168.10.64; |
89 |
option host-name "testbox-1"; |
90 |
ddns-hostname "testbox-1.eglifamily.name"; |
91 |
} |
92 |
|
93 |
|
94 |
-- |
95 |
Dan Egli |
96 |
From my Test Server |