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