* Update test-upstart-job.sh for Upstart 0.6.
svn path=/nixos/trunk/; revision=19939
This commit is contained in:
parent
dbc03fbf68
commit
c373ac846d
@ -1,29 +1,20 @@
|
|||||||
#! /bin/sh -e
|
#! /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
|
for i in $*; do
|
||||||
echo "building job $i..."
|
echo "building job $i..."
|
||||||
nix-build /etc/nixos/nixos -A "tests.upstartJobs.$i" -o $tmpDir/.result
|
nix-build /etc/nixos/nixos -A "config.jobs.$i" -o $tmpDir/.result
|
||||||
ln -sfn $(readlink -f $tmpDir/.result)/etc/event.d/* /tmp/event.d/
|
# !!! Here we assume that the attribute name equals the Upstart
|
||||||
|
# job name.
|
||||||
|
ln -sfn $(readlink -f $tmpDir/.result) /etc/init/"$i".conf
|
||||||
done
|
done
|
||||||
|
|
||||||
ln -sfn /tmp/event.d /etc/event.d
|
|
||||||
|
|
||||||
echo "restarting init..."
|
echo "restarting init..."
|
||||||
kill -TERM 1
|
initctl reload-configuration
|
||||||
|
|
||||||
sleep 1
|
sleep 1
|
||||||
|
|
||||||
for i in $*; do
|
for i in $*; do
|
||||||
echo "restarting job $i..."
|
echo "restarting job $i..."
|
||||||
initctl stop "$i"
|
initctl stop "$i" || true
|
||||||
sleep 1
|
|
||||||
initctl start "$i"
|
initctl start "$i"
|
||||||
done
|
done
|
||||||
|
Loading…
x
Reference in New Issue
Block a user