[OpenWrt-Devel] [PATCH] base-files: add /etc/profile.d support

thomas.langer at lantiq.com thomas.langer at lantiq.com
Wed Jun 10 07:47:00 EDT 2015


Hello Bastian,

> 
> i like the idea, but please use at least:
> 
> command . $i
> or
> ( . $i )

I think this will not work, as /etc/profile (and these additional files) is expected to be executed in the current shell context.
Otherwise adding shell variables or extending $PATH will not work. So you cannot execute them in a subshell.

> 
> otherwise a syntax error / file error will prevent a login.

Maybe it is possible to skip this for FAILSAFE mode? If there are errors, they can be corrected in this way.

> also use the unofficial simplified OpenWrt style here, it is OK to:
> 
> for FILE in /etc/profile.d/*; do
>   [ -e "$FILE" ] && ( . $FILE )
> done

The same issue with subshell...
> 
> i'am also unsure if 'unset FILE' is maybe overkill...
> 
> bye, bastian

Best Regards,
Thomas
---
There are two hard things in computer science: cache invalidation, naming things, and off-by-one errors.
---
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel



More information about the openwrt-devel mailing list