some small changes...probably the way it is done now (declaring the
dependencies, such as "networking" in Nix expressions) is not entirely
right, at least, trying to start them from for example this SSH script is
not the right way. A cleaner solution is being developed :)
svn path=/nixpkgs/trunk/; revision=5034
commit304f3fbe9dc7aae249981d395ae8b80f60a1d072
authorArmijn Hemel <armijn@gpl-violations.org>
dateTue 14 Mar 2006, 13:44 (21 years ago)
parent8befb63
pkgs/servers/server-scripts/generic/functions+3−1
@@ -22,6 +22,7 @@ start_deps() {
2222
2323start_softdeps() {
2424 for i in $softdeps; do
25+ echo $i
2526 $i start
2627 RETVAL=$?
2728 if test $RETVAL != 0; then
@@ -40,7 +41,8 @@ start() {
4041 # launch all hard dependencies
4142 #start_deps
4243 # launch all preferred dependencies
43− #start_softdeps
44+ echo "softdeps" $softdeps
45+ start_softdeps
4446 # launch our own program
4547 startService
4648 # if successful, then register
pkgs/servers/ssh-script/builder.sh+1
@@ -6,6 +6,7 @@ sed -e "s^@bash\@^$bash^g" \
66 -e "s^@sshd\@^$ssh^g" \
77 -e "s^@initscripts\@^$initscripts^g" \
88 -e "s^@coreutils\@^$coreutils^g" \
9+ -e "s^@softdeps\@^$softdeps^g" \
910 < $script > $out/$nicename
1011
1112chmod +x $out/$nicename
pkgs/servers/ssh-script/default.nix+3−1
@@ -1,10 +1,12 @@
1−{stdenv, ssh, bash, initscripts, coreutils, key ? null}:
1+{stdenv, ssh, bash, initscripts, coreutils, key ? null, syslog ? null, networking}:
22
33stdenv.mkDerivation {
44 name = "ssh-script-0.0.1";
55 nicename = "sshd";
66 server = "ssh";
77 builder = ./builder.sh ;
8+ softdeps = [syslog];
9+ deps = [networking];
810 inherit bash ssh initscripts coreutils;
911 script = [./sshd];
1012}
pkgs/servers/ssh-script/sshd+5−1
@@ -21,6 +21,8 @@ source @initscripts@/functions
2121RETVAL=0
2222prog="sshd"
2323
24+softdeps="@softdeps@"
25+
2426# Some functions to make the below more readable
2527KEYGEN=@sshd@/bin/ssh-keygen
2628SSHD=@sshd@/sbin/sshd
@@ -106,7 +108,9 @@ startService()
106108stopService()
107109{
108110 echo -n $"Stopping $prog:"
109− killproc $SSHD -TERM
111+ #killproc $SSHD -TERM
112+ echo "blaat"
113+ @coreutils@/bin/kill `@coreutils@/bin/cat /var/run/sshd.pid`
110114 RETVAL=$?
111115 [ "$RETVAL" = 0 ] && @coreutils@/bin/rm -f /var/lock/subsys/sshd
112116 echo