diff options
| author | Paul Buetow <paul@buetow.org> | 2022-04-30 09:53:49 +0100 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2022-04-30 09:53:49 +0100 |
| commit | 11650faa5ba2e35aa6a6f95bc22506817528a771 (patch) | |
| tree | 054e6215159d0f05bf58708aea06bf13920469a6 | |
| parent | 1af3a64e6d4f51f524e44c0082d450ed128b2a87 (diff) | |
rename ha to failunderd
| -rw-r--r-- | frontends/Rexfile | 19 | ||||
| -rw-r--r-- | frontends/usr/local/bin/ha.pl | 3 |
2 files changed, 6 insertions, 16 deletions
diff --git a/frontends/Rexfile b/frontends/Rexfile index 654618b..d240c6b 100644 --- a/frontends/Rexfile +++ b/frontends/Rexfile @@ -116,7 +116,7 @@ task 'base', group => 'frontends', pkg 'vger', ensure => present; pkg 'zsh', ensure => present; - append_if_no_such_line '/etc/rc.conf.local', 'pkg_scripts="uptimed httpd"'; + append_if_no_such_line '/etc/rc.conf.local', 'pkg_scripts="uptimed httpd failunderd"'; file '/etc/myname', content => template('./etc/myname.tpl', fqdns => $fqdns), @@ -286,21 +286,10 @@ task 'nsd_slaves', group => 'dnsslaves', service 'nsd', ensure => 'started'; }; -desc 'Setup HA'; -task 'ha', group => 'frontends', +desc 'Setup failunderd'; +task 'failunderd', group => 'frontends', sub { - file '/usr/local/bin/ha.pl', - source => './usr/local/bin/ha.pl', - owner => 'root', - group => 'wheel', - mode => '755'; - file '/var/run/ha.status', - content => '# Initial HA status file', - owner => 'www', - group => 'wheel', - mode => '644', - no_overwrite => TRUE; }; # COMBINED TASKS SECTION @@ -315,7 +304,7 @@ task 'commons', group => 'frontends', inetd(); relayd(); smtpd(); - ha(); + failunderd(); }; 1; diff --git a/frontends/usr/local/bin/ha.pl b/frontends/usr/local/bin/ha.pl index 5aba2bb..145d06e 100644 --- a/frontends/usr/local/bin/ha.pl +++ b/frontends/usr/local/bin/ha.pl @@ -12,11 +12,12 @@ use Data::Dumper; use constant { STATUS_FILE => '/var/run/ha.status', + # TMP file must be on the same FS as the final file! TMP_STATUS_FILE => '/tmp/ha.status', PARTICIPANTS => qw(blowfish.buetow.org twofish.buetow.org), HA_STATUS_PORT => 4242, MAX_STATUS_AGE => 60, -} +}; sub update_ha_status { my @status = @_; |
