[Piuparts-commits] [SCM] piuparts git repository branch, master, updated. 0.51

Andreas Beckmann anbe at debian.org
Wed May 15 10:10:17 UTC 2013


The following commit has been merged in the master branch:
commit 7b56e6f8bfef597f9b36e7bd238399d3385a86b7
Author: Andreas Beckmann <anbe at debian.org>
Date:   Tue May 14 14:24:09 2013 +0200

    Revert "Update slave-run to use get_config_value"
    
    This reverts commit fc6629837aabeeee3aff86942d05a223adec3d27.

diff --git a/slave-bin/slave_join b/slave-bin/slave_join
index 7b6da62..b127e66 100755
--- a/slave-bin/slave_join
+++ b/slave-bin/slave_join
@@ -1,7 +1,7 @@
 #!/bin/sh
 set -e
 
-# Copyright 2009-2013 Holger Levsen (holger at layer-acht.org)
+# Copyright 2009-2010 Holger Levsen (holger at layer-acht.org)
 # Copyright © 2013 Andreas Beckmann (anbe at debian.org)
 #
 # This program is free software; you can redistribute it and/or modify it
@@ -33,6 +33,8 @@ if ! `echo $SLAVENUM | grep -E -e "^[0-9]{1}$" >/dev/null` ; then
    exit
 fi
 
+SCREENLOG=/var/lib/piuparts/slave/screenlog.$SLAVENUM
+
 if [ $(ps fax|grep piuparts-slave|grep slave/$SLAVENUM|grep -v grep |wc -l) != 0 ] ; then
   screen -r -S piuparts-slave-screen -p $SLAVENUM -x
 else
diff --git a/slave-bin/slave_run.in b/slave-bin/slave_run.in
index c517623..17185e2 100755
--- a/slave-bin/slave_run.in
+++ b/slave-bin/slave_run.in
@@ -1,7 +1,7 @@
 #!/bin/sh
 set -e
 
-# Copyright 2009-2013 Holger Levsen (holger at layer-acht.org)
+# Copyright 2009-2011 Holger Levsen (holger at layer-acht.org)
 # Copyright © 2013 Andreas Beckmann (anbe at debian.org)
 #
 # This program is free software; you can redistribute it and/or modify it
@@ -33,43 +33,38 @@ if ! `echo $SLAVENUM | grep -E -e "^[0-9]{1}$" >/dev/null` ; then
    exit
 fi
 
-. @sharedir@/piuparts/lib/read_config.sh
+SLAVEROOTDIR=/var/lib/piuparts/slave
+SLAVEDIR=$SLAVEROOTDIR/$SLAVENUM
 
-get_config_value PYTHONPATH global PYTHONPATH ''
-get_config_value SLAVEROOT global slave-directory
-get_config_value PIUPARTS_TMPDIR global tmpdir
-
-export PYTHONPATH
-SLAVEDIR=$SLAVEROOT/$SLAVENUM
-SCREENLOG=$SLAVEROOT/screenlog.$SLAVENUM
-
-# cleanup cruft from previous runs
- at sharedir@/piuparts/slave/slave_cleanup
+if [ ! -d $SLAVEDIR ] ; then
+   install -d $SLAVEDIR
+   chown piupartss:piuparts $SLAVEDIR
+fi
 
-# ensure the temporary directory exists
-mkdir -p $PIUPARTS_TMPDIR
+SCREENLOG=$SLAVEROOTDIR/screenlog.$SLAVENUM
+MONITORDIR=/var/lib/piuparts/master/monitor-slave
 
-# ensure the slave directory exists
-mkdir -p $SLAVEDIR
+# prepare environment
+rm -f $SCREENLOG
 
-cd $SLAVEROOT
+cd $SLAVEROOTDIR
 (ps fax|grep -v grep| grep piuparts-slave | grep $SLAVEDIR ) && exit 0
 rm -f $SCREENLOG || :					# used by ~piupartsm/bin/detect_slave_problems
+rm -f $MONITORDIR/*					# used by several scripts to only warn once a day
 
 trap "cat $SCREENLOG | mail -s 'slave abnormaly ended' piupartsm ; rm $SCREENLOG; exit" TERM EXIT
 
 # if screen session does not exist, create it
 # remove screen logs to preserve slave_join logic
 ( ps ax | grep SCREEN | grep piuparts-slave-screen >/dev/null) ||\
-    ( cd $SLAVEROOT; screen -d -m -L -S piuparts-slave-screen; sleep 1; rm -f $SLAVEROOT/screenlog.*)
+    ( cd $SLAVEROOTDIR; screen -d -m -L -S piuparts-slave-screen; sleep 1; rm -f $SLAVEROOTDIR/screenlog.*)
 
 # make sure there is a window for this slave
 screen -S piuparts-slave-screen -X screen -L $SLAVENUM
 
 # launch the slave
-cd $SLAVEDIR
 screen -S piuparts-slave-screen -p $SLAVENUM -X stuff "
- at sharedir@/piuparts/piuparts-slave
+su - piupartss -c \"cd $SLAVEDIR; python /usr/share/piuparts/piuparts-slave\"
 "
 
 trap - TERM EXIT

-- 
piuparts git repository



More information about the Piuparts-commits mailing list