diff --git a/snapcraft.yaml b/snapcraft.yaml index aef044ed..51ed7721 100644 --- a/snapcraft.yaml +++ b/snapcraft.yaml @@ -11,8 +11,15 @@ apps: subiquity: command: usr/bin/subiquity-cmd environment: + # Save original values of environment variables, we want to restore them + # for the debug shell (LP: #1975629) and restart (LP: #1978139) + PYTHONPATH_ORIG: $PYTHONPATH + PATH_ORIG: $PATH + PYTHONIOENCODING_ORIG: $PYTHONIOENCODING PYTHONIOENCODING: utf-8 + SUBIQUITY_ROOT_ORIG: $SUBIQUITY_ROOT SUBIQUITY_ROOT: $SNAP + PYTHON_ORIG: $PYTHON PYTHON: $SNAP/usr/bin/python3.8 probert: command: bin/probert diff --git a/subiquity/client/client.py b/subiquity/client/client.py index cecd1cc3..f266341b 100644 --- a/subiquity/client/client.py +++ b/subiquity/client/client.py @@ -203,7 +203,7 @@ class SubiquityClient(TuiApplication): cmdline.extend(['--server-pid', self.opts.server_pid]) log.debug("restarting %r", cmdline) - os.execvp(cmdline[0], cmdline) + os.execvpe(cmdline[0], cmdline, orig_environ(os.environ)) def resp_hook(self, response): headers = response.headers diff --git a/subiquity/server/controllers/refresh.py b/subiquity/server/controllers/refresh.py index 5cbac3ab..5ef5693f 100644 --- a/subiquity/server/controllers/refresh.py +++ b/subiquity/server/controllers/refresh.py @@ -215,7 +215,7 @@ class RefreshController(SubiquityController): async def start_update(self, context): change = await self.app.snapd.post( 'v2/snaps/{}'.format(self.snap_name), - {'action': 'refresh'}) + {'action': 'refresh', 'ignore-running': True}) context.description = "change id: {}".format(change) return change