1) It is specified Ampoule behaviour to restart dead processes, that’s where the repeated new processes come from. The second process dies very early in its lifetime.
p = os.path.split(imp.find_module(pkg)[1])[0]
return reactor.spawnProcess(processProtocol, sys.executable, args,env, path, uid, gid, usePTY)
Goebel Consult, Landshut
http://www.goebel-consult.de
Blog:
http://www.goebel-consult.de/blog/kurzanalyse-disconnect.me
Kolumne:
http://www.cissp-gefluester.de/2011-09-kommerz-uber-recht-fdp-die-gefaellt-mir-partei
Goebel Consult ist Mitglied bei http://www.7-it.de/
So at first you have to find out, why this process dies.
Unfortunately you say nothing about the second program. Does it run if started manually?
Did you try with a *simple* second program like "import time; time.sleep(300)”?
"sys.executable ... In a bundled app, it is the path to the bundled executable.”
BTW: The git-repo of aether is called "aether-public". Is this the complete source, or is there also a private part?
The second program, which is the child process, runs on its own if I run it alone. It’s a GUI using PyQt and Qt. It
If you want to give a shot running it on your local machine, you can grab the code and follow the ‘Dependencies’ part of this blog post: http://blog.getaether.net/post/79723395145/aether-v1-1-is-here If you have PyQt5 / Qt installed, it should be fairly straightforward.
Have you bundled it using PyInstaller, too? Are you using MERGE?
Well, I'd prefer having a requirements.txt and a PyInstaller .spec-file, so I can immediately start looking into the problem. :-)
Have you bundled it using PyInstaller, too? Are you using MERGE?No, I haven’t. I haven’t had taken a look at Merge—up until now my belief was that multiprocessing did not need such tools. I can run Twisted’s own spawnProcess without bundling the subprocess or without merge, so I would think Ampoule would not change anything. It’s nothing but a wrapper over spawnProcess.
Well, I'd prefer having a requirements.txt and a PyInstaller .spec-file, so I can immediately start looking into the problem. :-)
My apologies, here’s the last working spec file I had.
a1 = Analysis(['/Volumes/Sky/Repos/aether/Code/aether/main.py'])
pyz1 = PYZ(a1.pure)
exe1 = EXE(pyz1, a1.scripts, ...)
a2 = Analysis(['/Volumes/Sky/Repos/aether/second-program.py'])
pyz2 = PYZ(a2.pure)
exe2 = EXE(pyz2, a2.scripts, ...)
coll = COLLECT(exe1, exe2
a1.binaries, a1.zipfiles, a1.datas,
a2.binaries, a2.zipfiles, a2.datas,
strip=None,
upx=True,
name='Aether'
)
I strongly suggest testing this with two very simple applications,
both of which only printing some text.Should I be packaging the second process on its own? Can Merge handle this?
Goebel Consult, Landshut
http://www.goebel-consult.de