From 67971a4349d0bb187a6d0dc8b8991529e79afc61 Mon Sep 17 00:00:00 2001 From: Armijn Hemel Date: Fri, 17 Mar 2006 16:33:59 +0000 Subject: [PATCH] dhclient would return 0 if invoked without an interface argument, so set this to eth0. Oh, what a hack...but it works :) svn path=/nixpkgs/trunk/; revision=5050 --- pkgs/servers/network-script/network | 11 ++++++++--- pkgs/servers/server-scripts/generic/functions | 18 ++++++++++++++++++ 2 files changed, 26 insertions(+), 3 deletions(-) diff --git a/pkgs/servers/network-script/network b/pkgs/servers/network-script/network index 8319e8e45fce..e676ff55a04c 100755 --- a/pkgs/servers/network-script/network +++ b/pkgs/servers/network-script/network @@ -15,17 +15,22 @@ source @initscripts@/functions RETVAL=0 prog="network" +INTERFACE=eth0 startService() { # just do networking - echo -n $"Starting $prog:" - @dhcp@/sbin/dhclient + echo -n "Starting $prog:" + @dhcp@/sbin/dhclient $INTERFACE + + RETVAL=$? + echo "retval $RETVAL" + return $RETVAL } stopService() { - echo -n $"Stopping $prog:" + echo "BLAAT" } reload() diff --git a/pkgs/servers/server-scripts/generic/functions b/pkgs/servers/server-scripts/generic/functions index 3fac760b9e02..d67370388f03 100644 --- a/pkgs/servers/server-scripts/generic/functions +++ b/pkgs/servers/server-scripts/generic/functions @@ -13,6 +13,7 @@ NIXPKGS=@nixpkgs@ start_deps() { for i in $deps; do + echo $i name=`$i/control name` if ! test -a "$RCDIR/$name"; then @@ -57,12 +58,28 @@ start() { # if not, continue # launch all hard dependencies start_deps + + RETVAL=$? + + if test $RETVAL != 0; then + echo $prog failed + exit $RETVAL + fi + # launch all preferred dependencies echo "softdeps" $softdeps start_softdeps # launch our own program startService # if successful, then register + + RETVAL=$? + + if test $RETVAL != 0; then + echo $prog failed + exit $RETVAL + fi + register } @@ -74,6 +91,7 @@ stop() { fi # stop our own program stopService + echo "unregistering" unregister }