Kitz ADSL Broadband Information
Home Broadband ISPs Tech Routers Wiki Forum
 
     
   Compare ISP   Rate your ISP
 

Servicecyclev4 patch

From kitz wiki
Revision as of 14:30, 22 July 2023 by Chrysalis (talk | contribs) (fix mistake)
Jump to: navigation, search

Default behaviour on pfSense is to cycle all services if any configured gateways go offline, this can include VPN's and tunnels not just broadband connectivity.

This can cause problems e.g. if your pfSense is hosting LAN services such as a NTP server or UPS daemon. Consider a scenario e.g. if you have a power cut, your WAN goes offline, pfSense then puts services into a cycle loop, which in turn drops connectivity to the UPS daemon so client machines are unaware of power status and battery level which might prevent automated safe shutdown/hibernation.

This patch changes the behaviour so services will only get cycled if a interface comes back online with a different IP address, if its a cycle keeping the existing IP, then it will not cycle all services, services such as OpenVPN should still behave the same as before.

This is the IPv4 version of the patch, there is also a IPv6 version.




Paste the below code into the Patch Contents box.

Add a description such as 'Better diagnostics limiters layout' in the Description box.

Set Path Strip Count to '0'.

Base Directory to '/'.

--- /etc/rc.newwanip    2023-04-18 03:05:04.404321000 +0100
+++ /etc/rc.newwanip       2023-04-18 03:05:50.740612000 +0100
@@ -233,10 +233,12 @@
                if (isset($config['system']['ip_change_kill_states'])) {
                        log_error("IP Address has changed, killing all states (ip_change_kill_states is set).");
                        pfSense_kill_states(utf8_encode($oldip));
+                       restart_packages();
                        filter_flush_state_table();
                } else {
                        log_error("IP Address has changed, killing states on former IP Address $oldip.");
                        pfSense_kill_states(utf8_encode($oldip));
+                       restart_packages();
                }
        }
 
@@ -270,7 +272,7 @@
        /* restart snmp */
        services_snmpd_configure();
 
-       restart_packages();
+       // restart_packages();
 } else {
        /* signal filter reload */
        filter_configure();