diff options
author | William Hubbs <w.d.hubbs@gmail.com> | 2018-02-24 16:24:08 -0600 |
---|---|---|
committer | William Hubbs <w.d.hubbs@gmail.com> | 2018-02-24 16:24:08 -0600 |
commit | cfded513cd9b7febe4b7cf39a80411e4303f0655 (patch) | |
tree | 15ef254a37e91663ad71bf125e06a6240de307cd /src/rc | |
parent | 16ff3cd8df6169f73e3d7cf00758a4703f62cbf0 (diff) |
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.
Diffstat (limited to 'src/rc')
-rw-r--r-- | src/rc/openrc-init.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/rc/openrc-init.c b/src/rc/openrc-init.c index eb346f59..de570e56 100644 --- a/src/rc/openrc-init.c +++ b/src/rc/openrc-init.c @@ -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); |