After doing a “yum update” (CentOS 7.9) and running “pf-maint” today our test 
cluster developed a problem where it failed starting the keepalived daemon. 


# perl -I/usr/local/pf/lib -Mpf::services::manager::keepalived -e 
'pf::services::manager::keepalived->new()->generateConfig()'
Can't use string ("") as an ARRAY ref while "strict refs" in use at 
/usr/local/pf/lib/pf/services/manager/keepalived.pm line 94.



Adding some debug printout in keepalived.pm around line 94 gives that the 
“static routes” field is empty:

# perl -I/usr/local/pf/lib -Mpf::services::manager::keepalived -e 
'pf::services::manager::keepalived->new()->generateConfig()'
$VAR1 = {
          'dhcpdetector' => 'enabled',
          'dhcp_rate_limiting' => 5,
          'connection_type_change_detection' => 'disabled',
          'staticroutes' => '',
          'dhcp_filter_by_message_types' => [
                                              'DHCPREQUEST',
                                              'DHCPACK'
                                            ],
          'rogue_dhcp_detection' => 'enabled',
          'rogueinterval' => '10',
          'force_listener_update_on_ack' => 'disabled',
          'interfaceSNAT' => '',
          'hostname_change_detection' => 'disabled',
          'dhcp_process_ipv6' => 'enabled',
          'dhcpoption82logger' => 'disabled'
        };



The following patch “fixes” the issue. I haven not investigated this issue in 
more detail but at least if seems to work for us after this fix…


diff -u pf/lib/pf/services/manager/keepalived.pm.ORIG 
pf/lib/pf/services/manager/keepalived.pm
--- pf/lib/pf/services/manager/keepalived.pm.ORIG       2022-02-12 
20:32:10.256958514 +0100
+++ pf/lib/pf/services/manager/keepalived.pm    2022-02-12 20:32:18.246341275 
+0100
@@ -91,11 +91,13 @@
 
 #Static from packetfence config
 EOT
+    if ($Config{'network'}{'staticroutes'}) {
     foreach my $route (@{$Config{'network'}{'staticroutes'}}) {
         $tags{'vrrp'} .= <<"EOT";
 $route
 EOT
     }
+    }
     $tags{'vrrp'} .= <<"EOT";
 #PacketFence managed networks
 $routes


 -Peter

_______________________________________________
PacketFence-users mailing list
PacketFence-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/packetfence-users

Reply via email to