mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-15 14:26:33 +01:00
938c76d5c0
svn path=/nixos/trunk/; revision=12245
27 lines
565 B
Bash
Executable file
27 lines
565 B
Bash
Executable file
#! /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 "upstartJobs.$i" -o $tmpDir/.result
|
|
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
|
|
|
|
for i in $*; do
|
|
echo "restarting job $i..."
|
|
initctl stop "$i"
|
|
sleep 1
|
|
initctl start "$i"
|
|
done
|