summaryrefslogtreecommitdiff
path: root/lib/Vyatta/Keepalived.pm
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Vyatta/Keepalived.pm')
-rwxr-xr-xlib/Vyatta/Keepalived.pm3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/Vyatta/Keepalived.pm b/lib/Vyatta/Keepalived.pm
index 325022f6..5267d102 100755
--- a/lib/Vyatta/Keepalived.pm
+++ b/lib/Vyatta/Keepalived.pm
@@ -38,7 +38,7 @@ my $keepalived_conf = '/etc/keepalived/keepalived.conf';
my $sbin_dir = '/opt/vyatta/sbin';
my $state_transition = "$sbin_dir/vyatta-vrrp-state.pl";
my $keepalived_pid = '/var/run/keepalived_vrrp.pid';
-my $state_dir = '/var/log/vrrpd';
+my $state_dir = '/var/run/vrrpd';
my $vrrp_log = "$state_dir/vrrp.log";
@@ -106,6 +106,7 @@ sub get_state_script {
sub get_state_file {
my ($vrrp_intf, $vrrp_group) = @_;
+ system("mkdir $state_dir") if ! -d $state_dir;
my $file = "$state_dir/vrrpd_" . "$vrrp_intf" . "_" . "$vrrp_group.state";
return $file;
}