On Thu, Feb 9, 2017 at 9:17 AM, Dan Smith via chirp_devel chirp_devel@intrepid.danplanet.com wrote:
I tried it last night and couldn't immediately make it work; if I understand correctly (and I may not), launchd has its own accounting of process names that setproctitle doesn't touch, so ps vs Activity Monitor/the menu bar will report different things after using setproctitle.
Hmm, but launchd is clearly noticing the exec and picking up the switch from sh to python, right? What if we setproctitle and then exec(self) in python?
Someone on the Python list points out that the Python framework binary is a member of its own app bundle with its own plists... https://lists.gt.net/python/python/955404#955404
Sure enough, tweaking CFBundleName in /opt/kk7ds/Library/Frameworks/Python.framework/Resources/Python.app/Contents/Info.plist shows that it's controlling the name in the menu bar.
Maybe the symlink has the effect of keeping the framework from finding the Python app plist so that it falls back to argv[0]?