[FIXED] DHCPv6 relay not started on boot
-
--- /etc/rc.bootup 2013-07-12 05:37:59.000000000 +0200 +++ /etc/rc.bootup 2013-07-12 17:52:39.000000000 +0200 @@ -340,6 +340,9 @@ /* start DHCP relay */ services_dhcrelay_configure(); +/* start DHCPv6 relay */ +services_dhcrelay6_configure(); + /* dyndns service updates */ send_event("service reload dyndnsall");
-
Seems an obvious oversight. I submitted a pull request on GitHub: https://github.com/pfsense/pfsense/pull/710
You can do that also - it is easy and makes it simple for the developers to see exactly the changes and quickly commit simple fixes. -
Seems an obvious oversight. I submitted a pull request on GitHub: https://github.com/pfsense/pfsense/pull/710
You can do that also - it is easy and makes it simple for the developers to see exactly the changes and quickly commit simple fixes.While at it, if you figure out the other bugs… I cannot find WTH is wrong with the checkbox. The service can never be stopped via disabling the checkbox and clicking save. On subsequent enabling, it launches another process, and so on and so on and so on.
-
There simply wasn't code in the service start/stop/restart routines to handle the dhcrelay6 service/process case.
I added that in pull request: https://github.com/pfsense/pfsense/pull/711/files
Now, for me, the service process is stopped when the checkbox is disabled, DHCPv6 Relay process is shown on Services-Status display, and the stop, start and restart buttons work. -
Now, for me, the service process is stopped when the checkbox is disabled, DHCPv6 Relay process is shown on Services-Status display, and the stop, start and restart buttons work.
Afraid this just does not work here. Unchecking the checkbox and clicking Save does still nothing, process still running. The checkbox only can launch more and more processes when enabled, never stops any when unchecked.
-
The old version put the PID file in the wrong place - /var/etc - so you will have to manually kill the old/wrong process the first time. (If you are not in production, then reboot is easy! Otherwise "ps aux | grep dhcrelay6" and find the offending PID and "kill nnnnn"). After that you should find the PID file /var/run/dhcrelay6.pid and the code will know how to find the process and stop/start it.
-
It still gets placed to /var/etc with your patch. Dunno what I'm missing here. I killed the processes over and over again, removed the pid file. Re-enabled, back to /var/etc. Are we talking about this patch?
https://github.com/phil-davis/pfsense/commit/9590e0de97bef964f16117f0094db24406754b64.patch
-
There is also a 1-line change to /etc/inc/services.inc - did you get that?
-
There is also a 1-line change to /etc/inc/services.inc - did you get that?
This? https://github.com/phil-davis/pfsense/commit/874f099a352f6e2a46f12b7b0daa6b1b5807a115.patch
No, but did now and it has absolutely no effect. Not that it could do anything:
grep dhcrelay6 /etc/inc/services.inc function services_dhcrelay6_configure() { echo "services_dhcrelay6_configure() being called $mt\n"; killbypid("{$g['varrun_path']}/dhcrelay6.pid"); $dhcrelaycfg =& $config['dhcrelay6']; $cmd = "/usr/local/sbin/dhcrelay -6 -pf \"{$g['varetc_path']}/dhcrelay6.pid\"";
See the last line.
-
This later one in the newer pull request: https://github.com/phil-davis/pfsense/commit/54a9d71ddf5d1ec4104af6d5ce849216abe752ac
It changes varetc_path to varrun_path -
Christ… reminds we exactly why I hate github…
-
After finally getting the scattered darned github stuff together - the below works for me…
--- a/etc/inc/services.inc +++ b/etc/inc/services.inc @@ -1404,7 +1404,7 @@ function services_dhcrelay6_configure() { return; if(isset($config['system']['developerspew'])) { $mt = microtime(); - echo "services_dhcrelay_configure() being called $mt\n"; + echo "services_dhcrelay6_configure() being called $mt\n"; } /* kill any running dhcrelay */ @@ -1505,7 +1505,7 @@ function services_dhcrelay6_configure() { return; /* XXX */ } - $cmd = "/usr/local/sbin/dhcrelay -6 -pf \"{$g['varetc_path']}/dhcrelay6.pid\""; + $cmd = "/usr/local/sbin/dhcrelay -6 -pf \"{$g['varrun_path']}/dhcrelay6.pid\""; foreach ($dhcrelayifs as $dhcrelayif) { $cmd .= " -l {$dhcrelayif}"; } --- a/etc/inc/service-utils.inc +++ b/etc/inc/service-utils.inc @@ -295,6 +295,13 @@ function get_services() { $services[] = $pconfig; } + if(isset($config['dhcrelay6']['enable'])) { + $pconfig = array(); + $pconfig['name'] = "dhcrelay6"; + $pconfig['description'] = gettext("DHCPv6 Relay"); + $services[] = $pconfig; + } + if(is_dhcp_server_enabled()) { $pconfig = array(); $pconfig['name'] = "dhcpd"; @@ -417,6 +424,9 @@ function get_service_status($service) { case "vhosts-http": $running = is_pid_running("{$g['varrun_path']}/vhosts-http.pid"); break; + case "dhcrelay6": + $running = is_pid_running("{$g['varrun_path']}/dhcrelay6.pid"); + break; default: $running = is_service_running($service['name']); } @@ -513,6 +523,12 @@ function service_control_start($name, $extras) { case 'bsnmpd': services_snmpd_configure(); break; + case 'dhcrelay': + services_dhcrelay_configure(); + break; + case 'dhcrelay6': + services_dhcrelay6_configure(); + break; case 'dnsmasq': services_dnsmasq_configure(); break; @@ -575,6 +591,9 @@ function service_control_stop($name, $extras) { case 'dhcrelay': killbypid("{$g['varrun_path']}/dhcrelay.pid"); break; + case 'dhcrelay6': + killbypid("{$g['varrun_path']}/dhcrelay6.pid"); + break; case 'dnsmasq': killbypid("{$g['varrun_path']}/dnsmasq.pid"); break; @@ -626,6 +645,12 @@ function service_control_restart($name, $extras) { case 'bsnmpd': services_snmpd_configure(); break; + case 'dhcrelay': + services_dhcrelay_configure(); + break; + case 'dhcrelay6': + services_dhcrelay6_configure(); + break; case 'dnsmasq': services_dnsmasq_configure(); break; --- a/etc/rc.bootup 2013-07-12 05:37:59.000000000 +0200 +++ b/etc/rc.bootup 2013-07-12 17:52:39.000000000 +0200 @@ -340,6 +340,9 @@ /* start DHCP relay */ services_dhcrelay_configure(); +/* start DHCPv6 relay */ +services_dhcrelay6_configure(); + /* dyndns service updates */ send_event("service reload dyndnsall");
Thumbs up, thanks! 8)
-
Good - jimp has taken these latest changes into main and 2.1 branch. The addition to the startup code (rc.bootup) hasn't got merged back into 2.1 branch yet, so it won't appear in a 2.1 snapshot. I have commented on that in GitHub and it should get noticed in due course.
-
While at it… noticed you added dhcrelay6 to services status/widget. Tried to do that with dhcrelay (not v6) without any luck
--- /etc/inc/service-utils.inc 2013-07-13 21:20:40.000000000 +0200 +++ /etc/inc/service-utils.inc 2013-07-13 20:27:25.000000000 +0200 @@ -424,6 +424,9 @@ case "vhosts-http": $running = is_pid_running("{$g['varrun_path']}/vhosts-http.pid"); break; + case "dhcrelay": + $running = is_pid_running("{$g['varrun_path']}/dhcrelay.pid"); + break; case "dhcrelay6": $running = is_pid_running("{$g['varrun_path']}/dhcrelay6.pid"); break;
Guess I'm missing some additional place.
-
The way it detected if dhcrelay was enabled was simply wrong (or out-of-date).
Fixed by: https://github.com/pfsense/pfsense/pull/712
Hopefully this clears up all the control issues for dhcrelay* :) -
The way it detected if dhcrelay was enabled was simply wrong (or out-of-date).
Fixed by: https://github.com/pfsense/pfsense/pull/712
Hopefully this clears up all the control issues for dhcrelay* :)Tested and works fine, thanks.
-
All the changes have been merged into the 2.1 branch. They are in the latest build and working.