Re: [vserver] Automatic gratuitous ARP on startup

From: Thomas Gebhardt <gebhardt_at_hrz.uni-marburg.de>
Date: Mon 22 Aug 2011 - 08:58:53 BST
Message-ID: <4E520C3D.3060802@hrz.uni-marburg.de>

Hello,

> Anyways, I would love to issue a gratuitous ARP (arping) when a vserver
> comes up, using the normal vserver-util framework. My hope is to find
> something akin to the "up do-stuff" ability of /etc/network/interfaces
> control file for ifup/ifdown.

we've got the following script in
/etc/vservers/.defaults/scripts/pre-start.d

Cheers, Thomas

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

SCRIPT=`basename $0`
VCFG=/etc/vservers/$2

[ -d $VCFG ] || { echo "$SCRIPT - $VCFG: No such directory" >&2; exit 1 ;}

for ipf in `ls $VCFG/interfaces/*/ip`; do

  [ -f $ipf ] || { echo "$SCRIPT - $ipf: No such file" >&2; exit 1 ;}

  IP=`head -n 1 $ipf`
  echo "arping -S $IP -B"
  timeout -15 2 arping -S $IP -B -q 2>&1 | grep -e "Timeout: aborting
command \`\`arping'' with signal 15" -q \
    || { echo "$SCRIPT - timeout command failed" >&2; exit 1 ;}
  echo "done"

done
Received on Mon Aug 22 08:59:16 2011

[Next/Previous Months] [Main vserver Project Homepage] [Howto Subscribe/Unsubscribe] [Paul Sladen's vserver stuff]
Generated on Mon 22 Aug 2011 - 08:59:17 BST by hypermail 2.1.8