* Update test-upstart-job.sh for Upstart 0.6.

svn path=/nixos/trunk/; revision=19939
This commit is contained in:
Eelco Dolstra 2010-02-11 16:14:47 +00:00
parent dbc03fbf68
commit c373ac846d

View File

@ -1,29 +1,20 @@
#! /bin/sh -e
tmpDir=/tmp/event.d
mkdir -p /tmp/event.d
if test "$(readlink -f /etc/event.d)" != /tmp/event.d; then
cp -prd "$(readlink -f /etc/event.d)"/* /tmp/event.d/
fi
for i in $*; do
echo "building job $i..."
nix-build /etc/nixos/nixos -A "tests.upstartJobs.$i" -o $tmpDir/.result
ln -sfn $(readlink -f $tmpDir/.result)/etc/event.d/* /tmp/event.d/
nix-build /etc/nixos/nixos -A "config.jobs.$i" -o $tmpDir/.result
# !!! Here we assume that the attribute name equals the Upstart
# job name.
ln -sfn $(readlink -f $tmpDir/.result) /etc/init/"$i".conf
done
ln -sfn /tmp/event.d /etc/event.d
echo "restarting init..."
kill -TERM 1
initctl reload-configuration
sleep 1
for i in $*; do
echo "restarting job $i..."
initctl stop "$i"
sleep 1
initctl stop "$i" || true
initctl start "$i"
done