openrc-init: use sbindir instead of hard-coded /sbin for PATH#1011
openrc-init: use sbindir instead of hard-coded /sbin for PATH#1011roman-kiselevich wants to merge 2 commits into
Conversation
| #define RC_PLUGINDIR "@RC_PLUGINDIR@" | ||
|
|
||
| #define RC_INIT_FIFO RC_SVCDIR"/init.ctl" | ||
| #define RC_INIT_DEFAULT_PATH "@SBINDIR@:/usr/sbin:/bin:/usr/bin" |
There was a problem hiding this comment.
Should we also put @BINDIR@ instead of /bin ?
There was a problem hiding this comment.
that would give it two /bin entries in the default setup
but we do need our tools to be in PATH
so ideally we'd add @bindir@ if it's not already /bin
or, for a better way to do that, remove /bin from the header, and on meson, set @bindir@ to either /bin or custom/path:/bin, depending on the configured value
There was a problem hiding this comment.
@navi-desu thx for your review. Is my understanding correct?
/bin still has to be on default path for backward compatibility even in case of custom bindir
There was a problem hiding this comment.
not for backwards compatibility, but for just, normal compatibility
the path isn't used just for openrc, but for the init scripts too, and any command they call (e.g. coreutils)
c64d578 to
fb66ca8
Compare
a user may want to install openrc binaries to a custom directory such as /opt/openrc. Before, the default PATH was hardcoded and openrc-init failed on startup in case of non-standard bindir, sbindir config. Now, for better debugging, PATH variable is logged before it is set, and the directories for PATH are set in rc.h. /bin still has to be on default path for backward compatibility even in case of custom bindir
fb66ca8 to
8a68598
Compare
This PR fixes the hard-coded part of /sbin default path. Moved the path_default var to rc.h.in macro as was suggested in the comment below. This issue was hard to find so I added one more log that can be useful because you just see this
do_exec: No such file or directorywithout any contextAlso, the issue was addressed here #205 (comment)