summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--pkgs/servers/server-scripts/generic/functions4
-rw-r--r--pkgs/servers/ssh-script/builder.sh1
-rw-r--r--pkgs/servers/ssh-script/default.nix4
-rwxr-xr-xpkgs/servers/ssh-script/sshd6
4 files changed, 12 insertions, 3 deletions
diff --git a/pkgs/servers/server-scripts/generic/functions b/pkgs/servers/server-scripts/generic/functions
index 42b13704ae4..6ed24b3d758 100644
--- a/pkgs/servers/server-scripts/generic/functions
+++ b/pkgs/servers/server-scripts/generic/functions
@@ -22,6 +22,7 @@ start_deps() {
 
 start_softdeps() {
 	for i in $softdeps; do
+		echo $i
 		$i start
 		RETVAL=$?
 		if test $RETVAL != 0; then
@@ -40,7 +41,8 @@ start() {
 	# launch all hard dependencies
 	#start_deps
 	# launch all preferred dependencies
-	#start_softdeps
+	echo "softdeps" $softdeps
+	start_softdeps
 	# launch our own program
 	startService
 	# if successful, then register
diff --git a/pkgs/servers/ssh-script/builder.sh b/pkgs/servers/ssh-script/builder.sh
index 4969616a352..a041a00118c 100644
--- a/pkgs/servers/ssh-script/builder.sh
+++ b/pkgs/servers/ssh-script/builder.sh
@@ -6,6 +6,7 @@ sed -e "s^@bash\@^$bash^g" \
     -e "s^@sshd\@^$ssh^g" \
     -e "s^@initscripts\@^$initscripts^g" \
     -e "s^@coreutils\@^$coreutils^g" \
+    -e "s^@softdeps\@^$softdeps^g" \
     < $script > $out/$nicename
 
 chmod +x $out/$nicename
diff --git a/pkgs/servers/ssh-script/default.nix b/pkgs/servers/ssh-script/default.nix
index a681a6b76c4..03897e26b35 100644
--- a/pkgs/servers/ssh-script/default.nix
+++ b/pkgs/servers/ssh-script/default.nix
@@ -1,10 +1,12 @@
-{stdenv, ssh, bash, initscripts, coreutils, key ? null}:
+{stdenv, ssh, bash, initscripts, coreutils, key ? null, syslog ? null, networking}:
 
 stdenv.mkDerivation {
   name = "ssh-script-0.0.1";
   nicename = "sshd";
   server = "ssh";
   builder = ./builder.sh ;
+  softdeps = [syslog];
+  deps = [networking];
   inherit bash ssh initscripts coreutils;
   script = [./sshd];
 }
diff --git a/pkgs/servers/ssh-script/sshd b/pkgs/servers/ssh-script/sshd
index 744bb49abc9..5668f8f9c23 100755
--- a/pkgs/servers/ssh-script/sshd
+++ b/pkgs/servers/ssh-script/sshd
@@ -21,6 +21,8 @@ source @initscripts@/functions
 RETVAL=0
 prog="sshd"
 
+softdeps="@softdeps@"
+
 # Some functions to make the below more readable
 KEYGEN=@sshd@/bin/ssh-keygen
 SSHD=@sshd@/sbin/sshd
@@ -106,7 +108,9 @@ startService()
 stopService()
 {
 	echo -n $"Stopping $prog:"
-	killproc $SSHD -TERM
+	#killproc $SSHD -TERM
+	echo "blaat"
+	@coreutils@/bin/kill `@coreutils@/bin/cat /var/run/sshd.pid`
 	RETVAL=$?
 	[ "$RETVAL" = 0 ] && @coreutils@/bin/rm -f /var/lock/subsys/sshd
 	echo