babeld: Print an error when startup fails
authorBaptiste Jonglez <baptiste--git@jonglez.org>
Wed, 27 Aug 2014 23:41:42 +0000 (01:41 +0200)
committerBaptiste Jonglez <baptiste--git@jonglez.org>
Fri, 29 Aug 2014 08:19:41 +0000 (10:19 +0200)
babeld/files/babeld.init

index ae45b03..65cd1ce 100755 (executable)
@@ -132,6 +132,12 @@ start() {
        config_foreach babel_filter filter
        # Using multiple config files is supported since babeld 1.5.1
        /usr/sbin/babeld -D -I "$pidfile" -c "$OTHERCONFIGFILE" -c "$CONFIGFILE"
+       # Wait for the pidfile to appear
+       for i in 1 2
+       do
+               [ -f "$pidfile" ] || sleep 1
+       done
+       [ -f "$pidfile" ] || (echo "Failed to start babeld"; exit 42)
 }
 
 stop() {