Normally the system boots with the startup scripts in /etc/init.d/ being
backgrounded by /etc/init.d/rcS, as in:

if [ "$1" = "S" ]; then
        run_scripts "$1" "$2" &
else
        run_scripts "$1" "$2"
fi



but I'm thinking it might be nice to allow a variable that controls
backgrounding (i.e. optionally turning it off, so the default behavior
remains the same).

When rcS runs, how much initialization has already taken place, and can
we pull config state out of /etc/config/system at that point?

Maybe something like:

config_load system
config_get_bool foreground system foreground no

if [ "$1" = "S" -a "$foreground" = "no" ]; then
        run_scripts "$1" "$2" &
else
        run_scripts "$1" "$2"
fi


Does that seem reasonable?


_______________________________________________
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel

Reply via email to