From c373ac846d1fa331d28c517902362871559e0dec Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Thu, 11 Feb 2010 16:14:47 +0000 Subject: [PATCH] * Update test-upstart-job.sh for Upstart 0.6. svn path=/nixos/trunk/; revision=19939 --- tests/test-upstart-job.sh | 21 ++++++--------------- 1 file changed, 6 insertions(+), 15 deletions(-) diff --git a/tests/test-upstart-job.sh b/tests/test-upstart-job.sh index 86be01bf602..d0fba23d625 100755 --- a/tests/test-upstart-job.sh +++ b/tests/test-upstart-job.sh @@ -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