Tkinter and root vs. Wayland

Terry Reedy tjreedy at udel.edu
Wed May 23 02:01:10 EDT 2018


On 5/22/2018 5:52 PM, Grant Edwards wrote:
> For a couple decades now, I've been distributing a couple smallish
> Tkinter applications that need to run as root for a variety of reasons
> (raw Ethernet access, starting/stopping daemons, loading and unloading
> kernel modules, reading and writing config files that are owned by
> root).
> 
> As part of RedHat's switch to Wayland, they've decided that GUI X11
> apps running as root will no longer be allowed to connect to the
> Wayland desktop server/compositor/whatever-it's-called.  When it was
> pointed out to RedHat that this will break lots of applications, the
> official word from on high is that all GUI apps requiring root
> privileges need to be redesigned so that their GUI is running as a
> normal user.
> 
> How does one do that in a Tkinter app?  Do I need to start as root and
> fork a process that drops privledges and starts Tkinter and then the
> two processes communicate via sockets or Posix queues or whatnot?

IDLE starts as a GUI process.  It uses subprocess to start a user-code 
execution process.  They communicate via a socket.  This usually works, 
but not always, so I may someday look into using multiprocessing.

-- 
Terry Jan Reedy




More information about the Python-list mailing list