Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 668214

Summary: =sys-apps/openrc-0.38.2 - openrc-run checkpath missing support of -p (--parents) option mkdir
Product: Gentoo Linux Reporter: Sergey S. Starikoff <Ikonta>
Component: Current packagesAssignee: OpenRC Team <openrc>
Status: UNCONFIRMED ---    
Severity: normal    
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---

Description Sergey S. Starikoff 2018-10-10 11:27:24 UTC
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.
Comment 1 William Hubbs gentoo-dev 2018-10-18 16:30:01 UTC
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
apply to?
Comment 2 Beelzebubbie 2018-10-19 09:51:59 UTC
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.