Skip to content

Commit

Permalink
CLOUDSTACK-8616 - Add a cron job to restart ConntrackD on reboot
Browse files Browse the repository at this point in the history
Signed-off-by: wilderrodrigues <[email protected]>
  • Loading branch information
wilderrodrigues committed Jul 16, 2015
1 parent f78a65c commit 4b3db3d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion systemvm/patches/debian/buildsystemvm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ packages() {
#xenstore utils
chroot . apt-get --no-install-recommends -q -y --force-yes install xenstore-utils libxenstore3.0
#keepalived - install version 1.2.13 from wheezy backports
chroot . apt-get --no-install-recommends -t wheezy-backports -q -y --force-yes install keepalived
chroot . apt-get --no-install-recommends -q -y --force-yes -t wheezy-backports install keepalived
#conntrackd
chroot . apt-get --no-install-recommends -q -y --force-yes install conntrackd ipvsadm libnetfilter-conntrack3 libnl1
#ipcalc
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,14 +139,21 @@ def _redundant_on(self):
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()

# Configure ConntrackD cron job - runs at every reboot
conntrackd_cron = CsFile("/etc/cron.d/conntrackd")
conntrackd_cron.add("SHELL=/bin/bash", 0)
conntrackd_cron.add("PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin", 1)
conntrackd_cron.add("@reboot root service conntrackd start", -1)
conntrackd_cron.commit()

proc = CsProcess(['/usr/sbin/keepalived', '--vrrp'])
if not proc.find() or keepalived_conf.is_changed():
CsHelper.service("keepalived", "restart")
Expand Down

0 comments on commit 4b3db3d

Please sign in to comment.