X-Git-Url: http://git.openwrt.org/?p=openwrt%2Fopenwrt.git;a=blobdiff_plain;f=package%2Fuhttpd%2Ffiles%2Fuhttpd.init;fp=package%2Fuhttpd%2Ffiles%2Fuhttpd.init;h=d4037a1b981b0800a3047fe948d7b14ff0ff1e3f;hp=c370f901099b6456ede8d2acb8abbd0e1d40c498;hb=8e9d914343967982a1a48e80000bbb09161e636c;hpb=54b34ccbc5a41e7bdbf29271dcc380715418f8c1 diff --git a/package/uhttpd/files/uhttpd.init b/package/uhttpd/files/uhttpd.init index c370f90109..d4037a1b98 100755 --- a/package/uhttpd/files/uhttpd.init +++ b/package/uhttpd/files/uhttpd.init @@ -108,6 +108,11 @@ start_instance() SERVICE_PID_FILE=/var/run/uhttpd_${cfg}.pid service_start $UHTTPD_BIN -f $UHTTPD_ARGS + + # Check if daemon is running, if not then + # re-execute in foreground to display error. + sleep 1 && service_check $UHTTPD_BIN || \ + $UHTTPD_BIN -f $UHTTPD_ARGS } stop_instance()