mirror of
https://github.com/apache/cloudstack.git
synced 2025-11-03 04:12:31 +01:00
CLOUDSTACK-8616 - Add keepalived start on reboot
- Runs check_heartbeat.sh every 30 seconds CLOUDSTACK-861 - Copy/Paste error - Paste the wrong command in the crontab line. Signed-off-by: wilderrodrigues <wrodrigues@schubergphilis.com>
This commit is contained in:
parent
20be22c698
commit
12ee36a55f
@ -137,12 +137,20 @@ class CsRedundant(object):
|
||||
if file.is_changed():
|
||||
CsHelper.service("keepalived", "reload")
|
||||
|
||||
# Configure heartbeat cron job
|
||||
cron = CsFile("/etc/cron.d/heartbeat")
|
||||
cron.add("SHELL=/bin/bash", 0)
|
||||
cron.add("PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin", 1)
|
||||
cron.add("*/1 * * * * root $SHELL %s/check_heartbeat.sh 2>&1 > /dev/null" % self.CS_ROUTER_DIR, -1)
|
||||
cron.commit()
|
||||
# Configure heartbeat cron job - runs every 30 seconds
|
||||
heartbeat_cron = CsFile("/etc/cron.d/heartbeat")
|
||||
heartbeat_cron.add("SHELL=/bin/bash", 0)
|
||||
heartbeat_cron.add("PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin", 1)
|
||||
heartbeat_cron.add("* * * * * root $SHELL %s/check_heartbeat.sh 2>&1 > /dev/null" % self.CS_ROUTER_DIR, -1)
|
||||
heartbeat_cron.add("* * * * * root sleep 30; $SHELL %s/check_heartbeat.sh 2>&1 > /dev/null" % self.CS_ROUTER_DIR, -1)
|
||||
heartbeat_cron.commit()
|
||||
|
||||
# Configure KeepaliveD cron job - runs at every reboot
|
||||
keepalived_cron = CsFile("/etc/cron.d/keepalived")
|
||||
keepalived_cron.add("SHELL=/bin/bash", 0)
|
||||
keepalived_cron.add("PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin", 1)
|
||||
keepalived_cron.add("@reboot root service keepalived start", -1)
|
||||
keepalived_cron.commit()
|
||||
|
||||
proc = CsProcess(['/usr/sbin/keepalived', '--vrrp'])
|
||||
if not proc.find():
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user