From 87eb734d38dff72ccdffd6c5f711d276aa3f9334 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Fri, 27 Sep 2013 00:41:33 +0200 Subject: gnu: dmd: Make the 'networking' service slightly more robust. * gnu/system/dmd.scm (static-networking-service)[start]: Sleep before running 'route', to leave time for the interface to come up. [stop]: Run "route del -net default". --- gnu/system/dmd.scm | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'gnu/system/dmd.scm') diff --git a/gnu/system/dmd.scm b/gnu/system/dmd.scm index 8cc3f61c74..4d3b4b31f0 100644 --- a/gnu/system/dmd.scm +++ b/gnu/system/dmd.scm @@ -178,10 +178,14 @@ true, it must be a string specifying the default network gateway." (start `(lambda _ (and (zero? (system* ,ifconfig ,interface ,ip "up")) ,(if gateway - `(zero? (system* ,route "add" "-net" "default" - "gw" ,gateway)) + `(begin + (sleep 3) ; XXX + (zero? (system* ,route "add" "-net" "default" + "gw" ,gateway))) #t)))) - (stop `(make-forkexec-constructor ,ifconfig ,interface "down")) + (stop `(lambda _ + (system* ,ifconfig ,interface "down") + (system* ,route "del" "-net" "default"))) (respawn? #f) (inputs `(("inetutils" ,inetutils) ,@(if gateway -- cgit v1.2.3