2008-06-30 00:18:39 +02:00
|
|
|
#! /bin/sh -e
|
|
|
|
|
|
|
|
for i in $*; do
|
|
|
|
echo "building job $i..."
|
2010-02-11 17:14:47 +01:00
|
|
|
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
|
2008-06-30 00:18:39 +02:00
|
|
|
done
|
|
|
|
|
|
|
|
echo "restarting init..."
|
2010-02-11 17:14:47 +01:00
|
|
|
initctl reload-configuration
|
2008-06-30 00:18:39 +02:00
|
|
|
|
2008-11-07 14:39:02 +01:00
|
|
|
sleep 1
|
|
|
|
|
2008-06-30 00:18:39 +02:00
|
|
|
for i in $*; do
|
|
|
|
echo "restarting job $i..."
|
2010-02-11 17:14:47 +01:00
|
|
|
initctl stop "$i" || true
|
2008-06-30 00:18:39 +02:00
|
|
|
initctl start "$i"
|
|
|
|
done
|