openrc-init: set a default path
The default path provided by the system if one isn't set only includes "/bin:/usr/bin". This adds the default path setting from sysvinit.
This commit is contained in:
parent
16ff3cd8df
commit
cfded513cd
@ -35,6 +35,7 @@
|
||||
#include "rc-wtmp.h"
|
||||
#include "version.h"
|
||||
|
||||
static const char *path_default = "/sbin:/usr/sbin:/bin:/usr/bin";
|
||||
static const char *rc_default_runlevel = "default";
|
||||
|
||||
static pid_t do_openrc(const char *runlevel)
|
||||
@ -183,6 +184,9 @@ int main(int argc, char **argv)
|
||||
sigaction(SIGINT, &sa, NULL);
|
||||
reboot(RB_DISABLE_CAD);
|
||||
|
||||
/* set default path */
|
||||
setenv("PATH", path_default, 1);
|
||||
|
||||
if (! reexec)
|
||||
init(default_runlevel);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user