https://bugs.freedesktop.org/show_bug.cgi?id=58664
Riccardo Magliocchetti <[email protected]> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED Resolution|--- |NOTOURBUG --- Comment #6 from Riccardo Magliocchetti <[email protected]> --- First of all for a more authoritative answer you may want to add someone like sberg. Said that i have a few considerations: - I don't see much value on starting and killing libreoffice instances on demand, unless it is a requirement i'd advice to let your init system / a process manager handle libo. - Regarding the issue i've never poked with pyuno directly but always used unoconv, this is the relevant bits it is using for killing a libo instance it started: ### If there is no GUI attached to the instance, terminate instance else: info(3, 'Terminating %s instance.' % product.ooName) try: convertor.desktop.terminate() except DisposedException: info(2, '%s instance unsuccessfully closed, sending TERM signal.' % product.ooName) try: ooproc.terminate() except AttributeError: os.kill(ooproc.pid, 15) info(3, 'Waiting for %s instance to exit.' % product.ooName) ooproc.wait() where convertor.desktop is: ### Do the LibreOffice component dance self.context = uno.getComponentContext() self.svcmgr = self.context.ServiceManager resolver = self.svcmgr.createInstanceWithContext("com.sun.star.bridge.UnoUrlResolver", self.context) unocontext = resolver.resolve("uno:%s" % op.connection) unosvcmgr = unocontext.ServiceManager self.desktop = unosvcmgr.createInstanceWithContext("com.sun.star.frame.Desktop", unocontext) and ooproc is: ooproc = subprocess.Popen([office.binary, "-headless", "-invisible", "-nocrashreport", "-nodefault", "-nofirststartwizard", "-nologo", "-norestore", "-accept=%s" % op.connection], env=os.environ) which brings me to this working patch: --- bugHeadless3.py 2013-12-29 14:17:48.542798672 +0100 +++ bugHeadless3.mod.py 2013-12-29 14:46:29.503332461 +0100 @@ -28,6 +28,7 @@ try: resolver = local.ServiceManager.createInstanceWithContext("com.sun.star.bridge.UnoUrlResolver", local) self._officeContext = resolver.resolve("uno:{0};StarOffice.ComponentContext".format(self.unoUrp())) + self.desktop = self._officeContext.ServiceManager.createInstanceWithContext("com.sun.star.frame.Desktop", self._officeContext) except NoConnectException as e: self.reset() raise Exception("Office not running (?): {0}".format(str(e))) @@ -118,7 +119,7 @@ if not self._officeContext is None: print("shutdownOffice") print(self._officeContext) - self._officeContext.dispose() + self.desktop.terminate() self.reset() time.sleep(1) return self So in conclusion it looks to me like an user error. Feel free to dig into unoconv history to see if that was a libo change done during times or just your script used to work by luck. Nobody here is to blame though since the API is horrible. -- You are receiving this mail because: You are the assignee for the bug.
_______________________________________________ Libreoffice-bugs mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs
