• Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Search
  • Register
  • Login
Netgate Discussion Forum
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Search
  • Register
  • Login

[FIXED] DHCPv6 relay not started on boot

Scheduled Pinned Locked Moved 2.1 Snapshot Feedback and Problems - RETIRED
17 Posts 2 Posters 3.5k Views
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D
    doktornotor Banned
    last edited by Jul 15, 2013, 7:14 AM Jul 12, 2013, 5:01 PM

    
    --- /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");
    
    
    1 Reply Last reply Reply Quote 0
    • P
      phil.davis
      last edited by Jul 13, 2013, 1:18 PM

      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.

      As the Greek philosopher Isosceles used to say, "There are 3 sides to every triangle."
      If I helped you, then help someone else - buy someone a gift from the INF catalog http://secure.inf.org/gifts/usd/

      1 Reply Last reply Reply Quote 0
      • D
        doktornotor Banned
        last edited by Jul 13, 2013, 1:58 PM

        @phil.davis:

        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.

        1 Reply Last reply Reply Quote 0
        • P
          phil.davis
          last edited by Jul 13, 2013, 4:24 PM

          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.

          As the Greek philosopher Isosceles used to say, "There are 3 sides to every triangle."
          If I helped you, then help someone else - buy someone a gift from the INF catalog http://secure.inf.org/gifts/usd/

          1 Reply Last reply Reply Quote 0
          • D
            doktornotor Banned
            last edited by Jul 13, 2013, 4:50 PM

            @phil.davis:

            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.

            1 Reply Last reply Reply Quote 0
            • P
              phil.davis
              last edited by Jul 13, 2013, 4:54 PM

              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.

              As the Greek philosopher Isosceles used to say, "There are 3 sides to every triangle."
              If I helped you, then help someone else - buy someone a gift from the INF catalog http://secure.inf.org/gifts/usd/

              1 Reply Last reply Reply Quote 0
              • D
                doktornotor Banned
                last edited by Jul 13, 2013, 4:59 PM Jul 13, 2013, 4:56 PM

                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

                1 Reply Last reply Reply Quote 0
                • P
                  phil.davis
                  last edited by Jul 13, 2013, 4:58 PM

                  There is also a 1-line change to /etc/inc/services.inc - did you get that?

                  As the Greek philosopher Isosceles used to say, "There are 3 sides to every triangle."
                  If I helped you, then help someone else - buy someone a gift from the INF catalog http://secure.inf.org/gifts/usd/

                  1 Reply Last reply Reply Quote 0
                  • D
                    doktornotor Banned
                    last edited by Jul 13, 2013, 5:03 PM

                    @phil.davis:

                    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.

                    1 Reply Last reply Reply Quote 0
                    • P
                      phil.davis
                      last edited by Jul 13, 2013, 5:26 PM

                      This later one in the newer pull request: https://github.com/phil-davis/pfsense/commit/54a9d71ddf5d1ec4104af6d5ce849216abe752ac
                      It changes varetc_path to varrun_path

                      As the Greek philosopher Isosceles used to say, "There are 3 sides to every triangle."
                      If I helped you, then help someone else - buy someone a gift from the INF catalog http://secure.inf.org/gifts/usd/

                      1 Reply Last reply Reply Quote 0
                      • D
                        doktornotor Banned
                        last edited by Jul 13, 2013, 5:27 PM

                        Christ… reminds we exactly why I hate github…

                        1 Reply Last reply Reply Quote 0
                        • D
                          doktornotor Banned
                          last edited by Jul 13, 2013, 6:06 PM Jul 13, 2013, 6:01 PM

                          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)

                          1 Reply Last reply Reply Quote 0
                          • P
                            phil.davis
                            last edited by Jul 14, 2013, 3:05 AM

                            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.

                            As the Greek philosopher Isosceles used to say, "There are 3 sides to every triangle."
                            If I helped you, then help someone else - buy someone a gift from the INF catalog http://secure.inf.org/gifts/usd/

                            1 Reply Last reply Reply Quote 0
                            • D
                              doktornotor Banned
                              last edited by Jul 14, 2013, 7:31 AM

                              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.

                              1 Reply Last reply Reply Quote 0
                              • P
                                phil.davis
                                last edited by Jul 14, 2013, 4:20 PM

                                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* :)

                                As the Greek philosopher Isosceles used to say, "There are 3 sides to every triangle."
                                If I helped you, then help someone else - buy someone a gift from the INF catalog http://secure.inf.org/gifts/usd/

                                1 Reply Last reply Reply Quote 0
                                • D
                                  doktornotor Banned
                                  last edited by Jul 14, 2013, 4:22 PM

                                  @phil.davis:

                                  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.

                                  1 Reply Last reply Reply Quote 0
                                  • P
                                    phil.davis
                                    last edited by Jul 15, 2013, 3:10 AM

                                    All the changes have been merged into the 2.1 branch. They are in the latest build and working.

                                    As the Greek philosopher Isosceles used to say, "There are 3 sides to every triangle."
                                    If I helped you, then help someone else - buy someone a gift from the INF catalog http://secure.inf.org/gifts/usd/

                                    1 Reply Last reply Reply Quote 0
                                    17 out of 17
                                    • First post
                                      17/17
                                      Last post
                                    Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.
                                      This community forum collects and processes your personal information.
                                      consent.not_received