~libertine-team/libertine/devel

« back to all changes in this revision

Viewing changes to python/libertine/ChrootContainer.py

libertine-launch: refactored core components of application session management.

Approved by Christopher Townsend, Stephen M. Webb, Larry Price, Libertine CI Bot, Brandon Schaefer.

Show diffs side-by-side

added added

removed removed

Lines of Context:
199
199
 
200
200
        return proot_cmd
201
201
 
202
 
    def launch_application(self, app_exec_line):
 
202
    def start_application(self, app_exec_line, environ):
203
203
        # FIXME: Disabling seccomp is a temporary measure until we fully understand why we need
204
204
        #        it or figure out when we need it.
205
 
        os.environ['PROOT_NO_SECCOMP'] = '1'
 
205
        environ['PROOT_NO_SECCOMP'] = '1'
206
206
 
207
207
        # Workaround issue where a custom dconf profile is on the machine
208
 
        if 'DCONF_PROFILE' in os.environ:
209
 
            del os.environ['DCONF_PROFILE']
 
208
        if 'DCONF_PROFILE' in environ:
 
209
            del environ['DCONF_PROFILE']
210
210
 
211
211
        proot_cmd = self._build_proot_command()
212
212
 
213
213
        args = shlex.split(proot_cmd)
214
214
        args.extend(utils.setup_window_manager(self.container_id, enable_toolbars=True))
215
 
        window_manager = psutil.Popen(args)
 
215
        window_manager = psutil.Popen(args, env=environ)
216
216
 
217
217
        args = shlex.split(proot_cmd)
218
218
        args.extend(app_exec_line)
219
 
        psutil.Popen(args).wait()
 
219
        app = psutil.Popen(args, env=environ)
 
220
        return app
220
221
 
 
222
    def finish_application(self, app):
221
223
        utils.terminate_window_manager(window_manager)
 
224
        app.wait()
222
225
 
223
226
    def _run_ldconfig(self, verbosity=1):
224
227
        if verbosity == 1:
227
230
        command_line = self._build_privileged_proot_cmd() + " ldconfig.REAL"
228
231
 
229
232
        args = shlex.split(command_line)
230
 
        subprocess.Popen(args).wait()
 
233
        app = subprocess.Popen(args)
 
234
        return app
 
235
 
 
236
    def finish_application(self, app):
 
237
        app.wait()