Skip to content
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

Running tapeimgr in GUI mode on BitCurator / Ubuntu 18.04LTS (Bionic) #19

Closed
bitsgalore opened this issue Nov 27, 2018 · 3 comments
Closed

Comments

@bitsgalore
Copy link
Member

bitsgalore commented Nov 27, 2018

The current launcher uses gksudo to run tapeimgr as root. But gksudo is not installed by default on BitCurator / Ubuntu 18.04LTS (Bionic). BitCurator does have the pkexec tool (which it uses to launch Guymager as root), but running the command:

pkexec tapeimgr

Results in this error:

_tkinter.TclError: no display name and no $DISPLAY environment variable

It seems that this not a bug, but a result of the pkexec/PolicyKit policy settings. See also:

https://groups.google.com/forum/#!topic/comp.lang.python/s4WMWIdkXMY

More on differences between pkexec and gksudo:

https://askubuntu.com/questions/78352/when-to-use-pkexec-vs-gksu-gksudo

And specifically on Python:

https://askubuntu.com/questions/288087/can-i-use-pkexec-in-a-python-script-or-a-desktop-file

@bitsgalore
Copy link
Member Author

bitsgalore commented Nov 27, 2018

Additional info: updated everything to pkexec, but now for some reason the launcher script tapeimgr-pkexec is not extracted during pip install (even though it is in the tarball!).

@bitsgalore
Copy link
Member Author

bitsgalore commented Nov 27, 2018

Missing pkexec fixed by:

1250313

Next problem:

  • Now initial dir is /root
  • Extraction freezes after 1st file; looks like something going wrong with the permissions (chown).

This happens because SUDO_UID, SUDO_GID and SUDO_USER are all undefined when running under pkexec!

Running pkexec with --user $USER at least results in a valid SUDO_USER BUT in that case we run as normal user and cannot access the tape device!

Apparently pkexec deliberately blocks most environment variables:

https://stackoverflow.com/questions/42960140/environment-variables-missing-when-executing-via-pkexec

Guymagr (which also uses pkexec) also uses /root as the starting dir.

A possible way to at least start tapeimgr with the user home dir as the default, would be to inject in a config file which is then read back.

@bitsgalore
Copy link
Member Author

All works now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant