[SOLVED] dhcpd.conf: execute on commit -> exit status 6
-
After updating to 2.1 my little nice modification of services.inc vanished (/etc/rc.create_full_backup obviously does not backup everything) which allowed for waking up my NAS every time a computer fetches its IP from the dhcpd. Besides copying the relevant files to the chroot environment for dhcpd my modification also added the following line to dhcpd.conf:
on commit { execute ("/usr/local/bin/wol", "-i", "192.168.1.255", "1c:c1:de:19:19:26"); }
This is what is printed in /var/log/dhcpd.log when a computer fetches its IP address:
Dec 21 20:46:46 pfsense dhcpd: DHCPDISCOVER from 18:8e:d5:d2:27:07 via vr0
Dec 21 20:46:46 pfsense dhcpd: DHCPOFFER on 192.168.1.14 to 18:8e:d5:d2:27:07 via vr0
Dec 21 20:46:46 pfsense dhcpd: execute_statement argv[0] = /usr/local/sbin/wol
Dec 21 20:46:46 pfsense dhcpd: execute_statement argv[1] = -i
Dec 21 20:46:46 pfsense dhcpd: execute_statement argv[2] = 192.168.1.255
Dec 21 20:46:46 pfsense dhcpd: execute_statement argv[3] = 1c:c1:de:19:19:26
Dec 21 20:46:46 pfsense dhcpd: execute: /usr/local/sbin/wol exit status 6After looking inside the wol sources I found that wol will never terminate with exit(6). Looks like the status is set by the fork() within dhcpd but I'm not able to figure out why. Changing file access rights and ownerships changes the exit status but never fixed the problem.
./lib:
total 1462
drwxr-xr-x 2 dhcpd _dhcp 512 Dec 22 17:31 .
drwxr-xr-x 9 root wheel 512 Dec 22 17:30 ..
-r–r--r-- 1 root _dhcp 1095964 Dec 21 20:02 libc.so.7./usr/local/bin:
total 24
drwxr-xr-x 2 dhcpd _dhcp 512 Dec 22 20:04 .
drwxr-xr-x 5 dhcpd _dhcp 512 Dec 22 20:04 ..
-r-xr-xr-x 1 dhcpd _dhcp 19920 Dec 21 20:02 wol./usr/local/lib:
total 1100
drwxr-xr-x 2 dhcpd _dhcp 512 Dec 21 20:02 .
drwxr-xr-x 5 dhcpd _dhcp 512 Dec 22 20:04 ..
-r--r--r-- 1 root _dhcp 1060645 Dec 21 20:02 libiconv.so.3
-r--r--r-- 1 root _dhcp 40747 Dec 21 20:02 libintl.so.9The lib* files are those which ldd lists as being necessary to run the wol command. The places are identical to the ones where they are placed normally but with respect to the chroot environment.
Any idea about what I missed to do?
-
Solved it by starting dhcpd with "-d". This showed an additional missing lib named "ld-elf.so.1". After copying this file also to the chroot-environment, everything was fine.