-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Line-buffered stdout logging of elevated process does not appear to work (osascript issue) #16
Comments
Never mind, it looks like this might be a limitation of osascript, not an elevate issue. See: https://stackoverflow.com/questions/49171769/how-where-to-best-retrieve-sudo-password-via-a-native-gui-on-a-macos-python-ba For now I have solved this by writing to a temp file and then polling it. However if it would be possible to have an option for |
Hello,
I am writing a python desktop GUI application and I wanted to embed a small installer into it. The idea is, when the user clicks on the install button, the GUI application will call itself with a special "run installer" argument. Then instead of launching another copy of the GUI, it would call elevate and then execute the installer script:
I noticed that
posix.py
will do nothing if its already running as root:https://github.com/barneygale/elevate/blob/master/elevate/posix.py#L25-L27
I also noticed that if I run this app as a normal user, the logs from
install_daemon.sh
wont appear until after the process exits. However if I run the app as root (causingelevate
to exit early instead of callingos.execlp(...)
) then the logs appear in real time. So far I have only tested in Mac OS. If you wish to see the full example my app is here, sorry about the messy code:https://git.sequentialread.com/forest/greenhouse-desktop/src/commit/aae851dcbac899360c449ab1e24594197c34582b
For now this issue is not going to block me, I will simply output to a temp file and then poll that file instead of doing stdout pipe.
The text was updated successfully, but these errors were encountered: