From 4a1260201d608083695b85d3dc3d104d31c456c4 Mon Sep 17 00:00:00 2001 From: lissav Date: Mon, 23 Sep 2013 12:02:52 -0400 Subject: [PATCH] defect 3618 --- xCAT-server/sbin/xcatconfig | 45 ++++++++++++++++++++++++++++++++++--- 1 file changed, 42 insertions(+), 3 deletions(-) diff --git a/xCAT-server/sbin/xcatconfig b/xCAT-server/sbin/xcatconfig index 0f46907b2..00102f048 100755 --- a/xCAT-server/sbin/xcatconfig +++ b/xCAT-server/sbin/xcatconfig @@ -241,6 +241,11 @@ if (xCAT::Utils->isMN()) { # Set tunables # # +if (($::settunables) && ( $::osname eq 'AIX')) { # not supported on AIX + xCAT::MsgUtils->message('E', "Setting tunables (-t) is not supported on AIX."); + exit 1; +} + if ($::FORCE || $::settunables || $::INITIALINSTALL ) { if ($::osname eq 'Linux') { @@ -848,9 +853,43 @@ sub genSSHRootKeys sub settunables { - xCAT::MsgUtils->message( - 'I', - "The set of tunables that will be initialized is TBD."); + # tuning ARP on Linux + # set for right now + my $cmd = "/bin/echo '1024' >/proc/sys/net/ipv4/neigh/default/gc_thresh1"; + my $outref = xCAT::Utils->runcmd("$cmd", 0); + if ($::RUNCMD_RC != 0) + { + xCAT::MsgUtils->message( 'E', "Could not run $cmd."); + } + $cmd = "/bin/echo '4096' >/proc/sys/net/ipv4/neigh/default/gc_thresh2"; + my $outref = xCAT::Utils->runcmd("$cmd", 0); + if ($::RUNCMD_RC != 0) + { + xCAT::MsgUtils->message( 'E', "Could not run $cmd."); + } + $cmd = "/bin/echo '8192' >/proc/sys/net/ipv4/neigh/default/gc_thresh3"; + my $outref = xCAT::Utils->runcmd("$cmd", 0); + if ($::RUNCMD_RC != 0) + { + xCAT::MsgUtils->message( 'E', "Could not run $cmd."); + } + # set for after reboot + if (!( -f "/etc/sysctl.conf.xcatbackup")){ # not already backed up + $cmd = "cp /etc/sysctl.conf /etc/sysctl.conf.xcatbackup"; + my $outref = xCAT::Utils->runcmd("$cmd", 0); + if ($::RUNCMD_RC != 0) + { + xCAT::MsgUtils->message( 'E', "Could not backup /etc/sysctl.conf."); + exit 1; + } + } + #delete all occurance of the attribute and then add xCAT settings + `sed -i '/net.ipv4.neigh.default.gc_thresh1 /'d /etc/sysctl.conf`; + `echo "net.ipv4.neigh.default.gc_thresh1 = 1024" >>/etc/sysctl.conf`; + `sed -i '/net.ipv4.neigh.default.gc_thresh2 /'d /etc/sysctl.conf`; + `echo "net.ipv4.neigh.default.gc_thresh2 = 4096" >>/etc/sysctl.conf`; + `sed -i '/net.ipv4.neigh.default.gc_thresh3 /'d /etc/sysctl.conf`; + `echo "net.ipv4.neigh.default.gc_thresh3 = 8192" >>/etc/sysctl.conf`; } #-----------------------------------------------------------------------------