Skip to content

Commit d7bb92f

Browse files
authored
Cleaner fix for poststart environment variables (#81)
* Revert "add JID and JNAME vars for poststart script (#78)" This reverts commit eb818df. * ioc_start.py: add JID and JNAME to poststart environment
1 parent 8fede35 commit d7bb92f

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

iocage_lib/ioc_start.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -871,9 +871,15 @@ def __start_jail__(self):
871871
f.write(f'{success}\n{error}')
872872

873873
# Running exec_poststart now
874+
_, jid = iocage_lib.ioc_list.IOCList().list_get_jid(self.uuid)
875+
post_start_env = {
876+
**os.environ,
877+
'JID': jid,
878+
'JNAME': f"ioc-{self.uuid}",
879+
}
874880
poststart_success, poststart_error = \
875881
iocage_lib.ioc_common.runscript(
876-
f"export JID=ioc-{self.uuid} JNAME={self.uuid};"+exec_poststart
882+
exec_poststart, post_start_env
877883
)
878884

879885
if poststart_error:

0 commit comments

Comments
 (0)