diff options
author | Anna (navi) Figueiredo Gomes <navi@vlhl.dev> | 2025-04-07 19:16:41 +0200 |
---|---|---|
committer | Anna (navi) Figueiredo Gomes <navi@vlhl.dev> | 2025-05-29 10:12:41 +0200 |
commit | 47f797f253db4a7caffeedd7a6d4340e17c3363d (patch) | |
tree | a6e665a8451339e911c9084c155bd50c322ec605 | |
parent | a1ae4dcba36743d12c2487855f2b2b8a7195162e (diff) |
openrc-run: import variabes from activation environmentorigin/rc-update-env
-rw-r--r-- | src/openrc-run/openrc-run.c | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/src/openrc-run/openrc-run.c b/src/openrc-run/openrc-run.c index 9ad19bfe..50706f04 100644 --- a/src/openrc-run/openrc-run.c +++ b/src/openrc-run/openrc-run.c @@ -709,8 +709,11 @@ svc_start_deps(void) tmplist = rc_stringlist_new(); TAILQ_FOREACH(svc, services, entries) { state = rc_service_state(svc->value); - if (state & RC_SERVICE_STARTED) + if (state & RC_SERVICE_STARTED) { + if (!rc_import_variables(svc->value)) + eerror("%s: failed to import variables from %s: %s", applet, svc->value, strerror(errno)); continue; + } /* Don't wait for services which went inactive but are * now in starting state which we are after */ @@ -727,8 +730,11 @@ svc_start_deps(void) eerror("%s: timed out waiting for %s", applet, svc->value); state = rc_service_state(svc->value); - if (state & RC_SERVICE_STARTED) + if (state & RC_SERVICE_STARTED) { + if (!rc_import_variables(svc->value)) + eerror("%s: failed to import variables from %s: %s", applet, svc->value, strerror(errno)); continue; + } if (rc_stringlist_find(need_services, svc->value)) { if (state & RC_SERVICE_INACTIVE || state & RC_SERVICE_WASINACTIVE) @@ -833,6 +839,8 @@ static void svc_start_real(void) static void svc_start(void) { + if (!rc_import_variables(NULL)) + eerror("%s: failed to import variables: %s", applet, strerror(errno)); if (dry_run) einfon("start:"); else @@ -943,8 +951,9 @@ svc_stop_deps(RC_SERVICE state) return; TAILQ_FOREACH(svc, tmplist, entries) { - if (rc_service_state(svc->value) & RC_SERVICE_STOPPED) + if (rc_service_state(svc->value) & RC_SERVICE_STOPPED) { continue; + } svc_wait(svc->value); if (rc_service_state(svc->value) & RC_SERVICE_STOPPED) continue; @@ -1015,9 +1024,10 @@ svc_stop_real(void) static int svc_stop(void) { - RC_SERVICE state; + RC_SERVICE state = 0; + + rc_import_variables(NULL); - state = 0; if (dry_run) einfon("stop:"); else |