diff --git a/tools/appliance/definitions/systemvmtemplate/configure_conntrack.sh b/tools/appliance/definitions/systemvmtemplate/configure_conntrack.sh new file mode 100644 index 00000000000..7fbd33a65be --- /dev/null +++ b/tools/appliance/definitions/systemvmtemplate/configure_conntrack.sh @@ -0,0 +1,19 @@ +# This is actually a bug in the conntrackd package. The comment in the conf file says stats logging is off by default but the parameter is set to on. +# After a couple weeks logrotate will rotate the conntrackd-stats.log file ans start conntracking even if we don't want it to (on non-redundant routers for instance). +fix_conntrackd() { + sed -i '/Stats {/,/}/ s/LogFile on/LogFile off/' /etc/conntrackd/conntrackd.conf + rm -f /var/log/conntrackd-stats.log +} + +# Preload these module otherwise the sysctl settings will not be set, and pasive ftp will not work. +fix_modules() { + cat >> /etc/modules << EOF +nf_conntrack_ipv4 +nf_conntrack +nf_conntrack_ftp +nf_nat_ftp +EOF +} + +fix_conntrackd +fix_modules diff --git a/tools/appliance/definitions/systemvmtemplate/definition.rb b/tools/appliance/definitions/systemvmtemplate/definition.rb index a2eb82bec6b..48c656cdf7b 100644 --- a/tools/appliance/definitions/systemvmtemplate/definition.rb +++ b/tools/appliance/definitions/systemvmtemplate/definition.rb @@ -64,6 +64,7 @@ config = { 'configure_login.sh', 'postinstall.sh', 'configure_acpid.sh', + 'configure_conntrack.sh', 'cleanup.sh', 'configure_networking.sh', 'zerodisk.sh' diff --git a/tools/appliance/definitions/systemvmtemplate/postinstall.sh b/tools/appliance/definitions/systemvmtemplate/postinstall.sh index f2ce1ae6d74..55d658bf79c 100644 --- a/tools/appliance/definitions/systemvmtemplate/postinstall.sh +++ b/tools/appliance/definitions/systemvmtemplate/postinstall.sh @@ -126,34 +126,15 @@ fix_hostname() { sed -i '/127.0.1.1/d' /etc/hosts } -# This is actually a bug in the conntrackd package. The comment in the conf file says stats logging is off by default but the parameter is set to on. -# After a couple weeks logrotate will rotate the conntrackd-stats.log file ans start conntracking even if we don't want it to (on non-redundant routers for instance). -fix_conntrackd() { - sed -i '/Stats {/,/}/ s/LogFile on/LogFile off/' /etc/conntrackd/conntrackd.conf - rm -f /var/log/conntrackd-stats.log -} - fix_vhdutil() { wget --no-check-certificate http://download.cloud.com.s3.amazonaws.com/tools/vhd-util -O /bin/vhd-util chmod a+x /bin/vhd-util } -# Preload these module otherwise the sysctl settings will not be set, and pasive ftp will not work. -fix_modules() { - cat >> /etc/modules << EOF -nf_conntrack_ipv4 -nf_conntrack -nf_conntrack_ftp -nf_nat_ftp -EOF -} - do_fixes() { fix_nameserver fix_hostname - fix_conntrackd fix_vhdutil - fix_modules } configure_apache2() {