Skip to content

Commit d90077a

Browse files
committed
openrc-run: import variabes from activation environment
1 parent 1844e9b commit d90077a

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

src/openrc-run/openrc-run.c

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -708,6 +708,7 @@ svc_start_deps(void)
708708
/* We use tmplist to hold our scheduled by list */
709709
tmplist = rc_stringlist_new();
710710
TAILQ_FOREACH(svc, services, entries) {
711+
rc_import_variables(svc->value);
711712
state = rc_service_state(svc->value);
712713
if (state & RC_SERVICE_STARTED)
713714
continue;
@@ -833,6 +834,7 @@ static void svc_start_real(void)
833834
static void
834835
svc_start(void)
835836
{
837+
rc_import_variables(NULL);
836838
if (dry_run)
837839
einfon("start:");
838840
else
@@ -943,8 +945,10 @@ svc_stop_deps(RC_SERVICE state)
943945
return;
944946

945947
TAILQ_FOREACH(svc, tmplist, entries) {
946-
if (rc_service_state(svc->value) & RC_SERVICE_STOPPED)
948+
rc_import_variables(svc->value);
949+
if (rc_service_state(svc->value) & RC_SERVICE_STOPPED) {
947950
continue;
951+
}
948952
svc_wait(svc->value);
949953
if (rc_service_state(svc->value) & RC_SERVICE_STOPPED)
950954
continue;
@@ -1015,9 +1019,10 @@ svc_stop_real(void)
10151019
static int
10161020
svc_stop(void)
10171021
{
1018-
RC_SERVICE state;
1022+
RC_SERVICE state = 0;
1023+
1024+
rc_import_variables(NULL);
10191025

1020-
state = 0;
10211026
if (dry_run)
10221027
einfon("stop:");
10231028
else

0 commit comments

Comments
 (0)