summary refs log blame commit diff
path: root/pkgs/os-specific/linux/upstart/jobcontrol.nix
blob: 5be0276ffd5262c6c40ee81862073168d67af480 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15














                                                                                                                                                      
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
	";
}