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 }