nixpkgs/pkgs/os-specific/linux/upstart/jobcontrol.nix
Yury G. Kudryashov d23f0bf7e9 merging trunk...
svn path=/nixpkgs/branches/stdenv-updates/; revision=9895
2007-12-08 15:21:03 +00:00

16 lines
413 B
Nix

args: with args;
stdenv.mkDerivation {
name = "upstart-jobcontrol";
buildCommand = "
mkdir -p \$out/bin
echo '
file=/etc/event.d/\$1
shift
controlscript=\$(egrep exec\\|respawn \$file | tail | sed -e s/^\\\\s\\\\+//g | sed -e s/\\\\s\\\\+/\\ /g | cut -f 2 -d \\ )
echo Running \$controlscript \"\$@\"
\$controlscript \"\$@\"
' >\$out/bin/jobcontrol
chmod a+x \$out/bin/jobcontrol
";
}