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 ae45b03f024c3d3b23caf213a918f85ee5bcc4c3..65cd1cedad5c53ac75ab44d1667fd89a5c66c568 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() {