[Pythonmac-SIG] How to run an app bundle as root?

Arve Knudsen arve.knudsen at gmail.com
Fri Nov 3 17:36:35 CET 2006


Hello

I'm writing a custom installation tool for OS X, which needs to run with
root privileges. The installation tool is packaged into an app bundle by way
of py2app. What I basically need to know is the best way of attaining root
privileges in the tool, must this be done with
AuthorizationExecuteWithPrivileges? I first tried this approach, writing a
wrapper script which executes the main script in a privileged Python
process. This doesn't quite work however, the resulting window behaves
completely different from what one would expect. That is, it can't get focus
and I can't command-tab to it.

I thought of another approach, which is to first run a privileged program
which setuid's the bundle executable, and then re-execute the bundle. Would
this be a good approach, and how can I execute the bundle programmatically?

Thanks,
Arve Knudsen
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/pythonmac-sig/attachments/20061103/ab4a1dbe/attachment.html 


More information about the Pythonmac-SIG mailing list