OpenRC provides a special built-in function to create directories (checkpath).
But this function works as mkdir command, i.e. just creates a directory, failing when need to create not only target directory but at least one intermediate.
Although init scripts usually use such case: not simple mkdir invocation, but mkdir -p.
So, we need either to add checkpath option, like --parents for mkdir, or switch checkpath command in this mode.
Tested with recently stable =sys-apps/openrc-0.38.2.
My concern about doing this is how the -o and -m options should work in
this scenario. For example, consider the following command:
checkpath --owner user:group --mode 0700 --parents /foo/bar/bas/end
The actions of --owner and --mode become ambiguous in that situation.
Is this an error? If not, which directories in the example should they
My opinion we should do the same as mkdir -p (--mode option), but extending it for owner. Yes, some ambiguities are unavoidable, but in most cases explicit applying mode and owner to the last dir in path is enough.