[Piuparts-commits] [SCM] piuparts git repository branch, piatti.git, updated. 4d2c7abb7c5a5a8ae3a0e51c77b65c605e0eb457

Holger Levsen holger at layer-acht.org
Sun Jan 22 12:25:27 UTC 2012


The following commit has been merged in the piatti.git branch:
commit 44bda99b6dfaefc2425dd3fd4a14965ccc5ab10e
Author: Holger Levsen <holger at layer-acht.org>
Date:   Fri Jan 20 11:56:44 2012 +0100

    new script ~piupartsm/bin/slave_cleanup to be run at reboots

diff --git a/home/piupartss/bin/slave_join b/home/piupartss/bin/slave_cleanup
similarity index 55%
copy from home/piupartss/bin/slave_join
copy to home/piupartss/bin/slave_cleanup
index a0c20b5..5bbd124 100755
--- a/home/piupartss/bin/slave_join
+++ b/home/piupartss/bin/slave_cleanup
@@ -1,6 +1,6 @@
-#!/bin/sh 
+#!/bin/sh
 
-# Copyright 2009-2010 Holger Levsen (holger at layer-acht.org)
+# Copyright 2012 Holger Levsen (holger at layer-acht.org)
 # 
 # This program is free software; you can redistribute it and/or modify it
 # under the terms of the GNU General Public License as published by the
@@ -17,17 +17,21 @@
 # 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 
 #
-# reattach to an existing slave session
+# cleanup /org/piuparts.debian.org/tmp/ 
+#
+# - this should only be run (automatically) on boot
 #
 set -e
 
-SCREENLOG=/org/piuparts.debian.org/slave/screenlog.0
+# do nothing if piuparts-slave is running
+[ $(ps fax|grep piuparts-slave|grep -v grep|wc -l)  ne 0 ] && exit 0
+
+# umount all mount points (should be none on boot, but this script can also be called at other times)
+for MOUNTPOINT in $(cat /proc/mounts|cut -d " " -f 2|grep /org/piuparts.debian.org/tmp/) ; do 
+	sudo umount $MOUNTPOINT
+done
+
+# cleanup tmp
+rm /org/piuparts.debian.org/tmp -Rf
+mkdir /org/piuparts.debian.org/tmp
 
-if [ -f $SCREENLOG ] ; then 
-  screen -R -S piuparts-slave-screen
-else
-  echo "$SCREENLOG does not exist, slave not running!"
-  echo 
-  echo "ps faxu | grep piuparts"
-  ps faxu | grep piuparts 
-fi
diff --git a/home/piupartss/crontab b/home/piupartss/crontab
index 814a1a5..7da94b1 100644
--- a/home/piupartss/crontab
+++ b/home/piupartss/crontab
@@ -7,7 +7,7 @@
 #
 # start slave_run automatically after reboots
 #
- at reboot sudo $HOME/bin/slave_run
+ at reboot $HOME/bin/slave_cleanup ; sudo $HOME/bin/slave_run
 
 #
 # monitor for problems every six hours

-- 
piuparts git repository



More information about the Piuparts-commits mailing list