diff options
author | Roy Marples <roy@marples.name> | 2007-05-15 15:56:35 +0000 |
---|---|---|
committer | Roy Marples <roy@marples.name> | 2007-05-15 15:56:35 +0000 |
commit | fc597a87219dc0de006f02081bfb9cbc6ddfe14b (patch) | |
tree | ae27185b5e9cb7787cd633f33c172b3bba506ae3 /src | |
parent | b20d600e49afc7a72d9ac7735b8a2bc591a80e70 (diff) |
/etc/conf.d/rc.$runlevel now works, #177869.
Diffstat (limited to 'src')
-rw-r--r-- | src/librc-misc.c | 9 | ||||
-rw-r--r-- | src/runscript.c | 6 |
2 files changed, 11 insertions, 4 deletions
diff --git a/src/librc-misc.c b/src/librc-misc.c index 36d9b318..ecb403a0 100644 --- a/src/librc-misc.c +++ b/src/librc-misc.c @@ -572,7 +572,7 @@ char **rc_config_env (char **env) char *line; int i; char *p; - char **config = rc_get_config (NULL, RC_CONFIG); + char **config; char *e; char sys[6]; struct utsname uts; @@ -580,6 +580,13 @@ char **rc_config_env (char **env) FILE *fp; char buffer[PATH_MAX]; + /* Don't trust environ for softlevel yet */ + snprintf (buffer, PATH_MAX, "%s.%s", RC_CONFIG, rc_get_runlevel()); + if (rc_exists (buffer)) + config = rc_get_config (NULL, buffer); + else + config = rc_get_config (NULL, RC_CONFIG); + STRLIST_FOREACH (config, line, i) { p = strchr (line, '='); if (! p) diff --git a/src/runscript.c b/src/runscript.c index 82484f13..50a1931e 100644 --- a/src/runscript.c +++ b/src/runscript.c @@ -975,6 +975,9 @@ int main (int argc, char **argv) int opt; service = argv[1]; + applet = rc_xstrdup (basename (service)); + atexit (cleanup); + /* Show help if insufficient args */ if (argc < 3) { execl (RCSCRIPT_HELP, RCSCRIPT_HELP, service, (char *) NULL); @@ -982,9 +985,6 @@ int main (int argc, char **argv) applet, strerror (errno)); } - applet = rc_xstrdup (basename (service)); - atexit (cleanup); - #ifdef __linux__ /* coldplug events can trigger init scripts, but we don't want to run them until after rc sysinit has completed so we punt them to the boot runlevel */ |