Configs are good too be saved,
authorroot <root@xenapi.xen>
Mon, 6 Oct 2008 01:59:27 +0000 (6 03:59 +0200)
committerroot <root@xenapi.xen>
Mon, 6 Oct 2008 01:59:27 +0000 (6 03:59 +0200)
Xen is too big script restart it when it is too big

node/configs/etc/conf.d/local.start [new file with mode: 0644]
node/xenistoobig.sh [new file with mode: 0755]

diff --git a/node/configs/etc/conf.d/local.start b/node/configs/etc/conf.d/local.start
new file mode 100644 (file)
index 0000000..504df1b
--- /dev/null
@@ -0,0 +1,17 @@
+# /etc/conf.d/local.start
+
+# This is a good place to load any misc programs
+# on startup (use &>/dev/null to hide output)
+
+/sbin/ifconfig xenbr0 up
+DOMAIN=`dmesg|grep host=|sed -e 's/.* domain=//' -e 's/,.*$//'`
+domainname $DOMAIN
+
+mkdir -p /var/run/libvirt
+cp -r /etc/pki/template/* /etc/pki/libvirt/.
+echo "cn = "`hostname`"."`domainname` >> /etc/pki/libvirt/server.info
+/usr/bin/certtool --generate-certificate --load-privkey /etc/pki/libvirt/private/serverkey.pem --load-ca-certificate /etc/pki/CA/cacert.pem --load-ca-privkey /etc/pki/CA/cakey.pem --template /etc/pki/libvirt/server.info --outfile /etc/pki/libvirt/servercert.pem
+
+/etc/init.d/libvirtd start
+screen -d -m /usr/local/sbin/node
+screen -d -m /usr/local/sbin/xenistoobig.sh
diff --git a/node/xenistoobig.sh b/node/xenistoobig.sh
new file mode 100755 (executable)
index 0000000..9681679
--- /dev/null
@@ -0,0 +1,7 @@
+#!/bin/sh
+while [ 1 ]; do
+        if [ `ps aux | grep "xend start" | awk '{ SUM += $6 } END { print SUM }'` -ge 120000 ]; then
+                killall xend; /etc/init.d/xend zap; /etc/init.d/xend start
+        fi
+        sleep 600
+done