kernel: fq_codel: dont reinit flow state
[openwrt/openwrt.git] / package / uhttpd / files / uhttpd.init
index c370f901099b6456ede8d2acb8abbd0e1d40c498..379a9f5b5f7d5806d86fe12f335274dede6c2045 100755 (executable)
@@ -72,6 +72,7 @@ start_instance()
        append_arg "$cfg" tcp_keepalive "-A"
        append_arg "$cfg" error_page "-E"
        append_arg "$cfg" index_page "-I"
+       append_arg "$cfg" max_requests "-n" 3
 
        append_bool "$cfg" no_symlinks "-S" 0
        append_bool "$cfg" no_dirlists "-D" 0
@@ -108,6 +109,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()