/usr/share/piuparts/slave/slave_run is in piuparts-slave 0.56ubuntu1.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 | #!/bin/sh
set -e
# Copyright 2009-2013 Holger Levsen (holger@layer-acht.org)
# Copyright © 2013 Andreas Beckmann (anbe@debian.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
# Free Software Foundation; either version 2 of the License, or (at your
# option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
# Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
# Run (several) piuparts-slave instance(s) in screen to allow interactive
# control later on.
#
. /usr/share/piuparts/lib/read_config.sh
get_config_value PYTHONPATH global PYTHONPATH ''
get_config_value SLAVEROOT global slave-directory
get_config_value PIUPARTS_TMPDIR global tmpdir
get_config_value SLAVECOUNT global slave-count 1
export PYTHONPATH
SESSIONNAME=piuparts_slave_screen
SCREENLOG=$SLAVEROOT/screenlog.0
if ! screen -ls $SESSIONNAME | grep -q "No Sockets found" ; then
echo "piuparts-slave is already running!"
echo
screen -ls
exit 1
fi
# cleanup cruft from previous runs
/usr/share/piuparts/slave/slave_cleanup
rm -f $SCREENLOG
# ensure the temporary directory exists
mkdir -p $PIUPARTS_TMPDIR
mkdir -p $SLAVEROOT
cd $SLAVEROOT
# Ensure the screen session exists, run normal shell in screen 0
screen -S $SESSIONNAME -d -m
echo "Started screen session '$SESSIONNAME'."
# run this on a single slave or a sequence of slaves
# FIXME: this should really test whether $1 is an integer and within SLAVECOUNT
if [ "$1" != "" ] ; then
SLAVES=$1
else
SLAVES="$(seq $SLAVECOUNT)"
fi
for SLAVENUM in $SLAVES
do
mkdir -p $SLAVENUM
SLAVEDIR=$(readlink -f $SLAVENUM)
# Ensure there is a window for this slave.
screen -S $SESSIONNAME -X screen -t slave$SLAVENUM -L $SLAVENUM
# Launch the slave.
screen -S $SESSIONNAME -p $SLAVENUM -X stuff "
cd $SLAVEDIR
/usr/share/piuparts/piuparts-slave
"
echo "piuparts-slave $SLAVENUM has been started."
done
|