2008-06-29 23:18:39 +01:00
|
|
|
#! /bin/sh -e
|
|
|
|
|
|
|
|
tmpDir=/tmp/event.d
|
|
|
|
|
2008-07-02 19:04:15 +01:00
|
|
|
mkdir -p /tmp/event.d
|
2008-06-29 23:18:39 +01:00
|
|
|
|
2008-07-02 19:04:15 +01:00
|
|
|
if test "$(readlink -f /etc/event.d)" != /tmp/event.d; then
|
|
|
|
cp -prd "$(readlink -f /etc/event.d)"/* /tmp/event.d/
|
|
|
|
fi
|
2008-06-29 23:18:39 +01:00
|
|
|
|
|
|
|
for i in $*; do
|
|
|
|
echo "building job $i..."
|
2008-11-18 18:00:09 +00:00
|
|
|
nix-build /etc/nixos/nixos -A "tests.upstartJobs.$i" -o $tmpDir/.result
|
2008-06-29 23:18:39 +01:00
|
|
|
ln -sfn $(readlink -f $tmpDir/.result)/etc/event.d/* /tmp/event.d/
|
|
|
|
done
|
|
|
|
|
|
|
|
ln -sfn /tmp/event.d /etc/event.d
|
|
|
|
|
|
|
|
echo "restarting init..."
|
|
|
|
kill -TERM 1
|
|
|
|
|
2008-11-07 13:39:02 +00:00
|
|
|
sleep 1
|
|
|
|
|
2008-06-29 23:18:39 +01:00
|
|
|
for i in $*; do
|
|
|
|
echo "restarting job $i..."
|
|
|
|
initctl stop "$i"
|
|
|
|
sleep 1
|
|
|
|
initctl start "$i"
|
|
|
|
done
|