Hanne's analysis:
vm_autorun.env is copied into the rapido root fs as /etc/profile,
and as such will be executed every time a login shell is invoked
(ie via 'su -' or 'sh -l'). As this script also serves as system
initialisation we need to make sure to run the initialisation only
once, and only export the environment variables for later invocations.
To avoid multiple invocations, we can use bash's explicit --rcfile parameter when starting the initial shell, and install vm_autorun.env in a path where it won't get invoked automatically (/rapido.rc).
To use bash with --rcfile, we also need to drop the explicit --login/-l parameter, which changes bash behaviour slightly:
(unused) profile paths are different
legacy fcntl(fd=[3->19], F_SETFD, FD_CLOEXEC) calls are skipped
I think we shouldn't see any side-effects for rapido workloads.
Hanne's analysis: vm_autorun.env is copied into the rapido root fs as /etc/profile, and as such will be executed every time a login shell is invoked (ie via 'su -' or 'sh -l'). As this script also serves as system initialisation we need to make sure to run the initialisation only once, and only export the environment variables for later invocations.
To avoid multiple invocations, we can use bash's explicit --rcfile parameter when starting the initial shell, and install vm_autorun.env in a path where it won't get invoked automatically (/rapido.rc).
To use bash with --rcfile, we also need to drop the explicit --login/-l parameter, which changes bash behaviour slightly:
I think we shouldn't see any side-effects for rapido workloads.
Reported-by: Hannes Reinecke hare@suse.de