* Yousong Zhou <[email protected]> [23.11.2013 10:58]: > > > Looks like most of them `exit` for a reason. Maybe we could instead just > > > document explicitly the way hotplug scripts are run and let scripts take > > > the > > > shortcut `exit` at appropriate time. > > > > i think there is no change needed. i have changed nothing with the > > patch, just the look and feel. IMHO the protection against exit is > > needed anyway, because a script can exit be accident (crash). > > Unexpected crash should be better fixed, not just isolated by forking a > sub-shell for it. Also the added load of forking a new shell for each > of those hotplug scripts is too much, I think.
you are right. i did a debug session here: http://intercity-vpn.de/files/openwrt/hotplug-debug.txt http://intercity-vpn.de/files/openwrt/hotplug-debug-output.txt and read here: http://www.gnu.org/software/bash/manual/bashref.html#Command-Grouping was puzzles me: the "PID_inside" is the same like from the main-script. should'nt it change? i also found, that it is possible to simply change all calls to "exit" to a "return", so the sourcing of a script will be aborted and no subshell is needed anymore. this must be somehow "enforced" by the openwrt-build: all files in "/etc/hotplug.d/"* cannot have the keyword "exit" in there 8-) otherwise we break the execution of further calls in the loop... bye, bastian _______________________________________________ openwrt-devel mailing list [email protected] https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
