[mythtv-users] X dpms problem SOLVED

Joe Ripley vitaminjoe at gmail.com
Fri Jun 13 14:42:07 UTC 2008

On Sun, Jun 8, 2008 at 4:47 PM, Robin Gilks <g8ecj at gilks.org> wrote:

> Well not so much solved as working now...
> My assumption that irexec was running as root was wrong. The init script
> that starts it in daemon mode runs it as a normal user (mythtv as it
> happens). By SUIDing the power on/off script as root I was actually making
> it worse as the root user is not allowed to connect to the X server.
> What I ended up doing was using
>   su mythtv -c '/usr/bin/xset dpms force on|off'
> having started the irexec process as root.
> Why that should work but running without the 'su' in the script and
> running irexec as the mythtv user in the first place sure beats me. At
> least it works now...
> If anyone can explain what is going on I'd appreciate it - maybe something
> to do with the root user spawning a process with a different uid misses
> something out?

The simplest method of solving all of these problems is to start
irexec in your .xinitrc script rather than as a system init script.
This way, irexec gets started by the X window session and
automatically has permission to access the DISPLAY variable.

I have this at the tail end of my .xinitrc, just before it starts up
the window manager:

xset s noblank
xset s off
xset -dpms
/usr/bin/irexec -d
/usr/bin/mtd -d &
sleep 10
/usr/bin/mythfrontend &
/usr/bin/xterm &

Joe Ripley
vitaminjoe at gmail.com

More information about the mythtv-users mailing list