Hi
all,
I have a little
problem attaching to a running server from a process started by
rc.local.
Basically I have a
program that must start prior to the X server to monitor a piece of
hardware. That process needs to open a small window on the user's display
once X starts. I have tested the program by starting from a console,
running the program which daemonizes itself and then I
startx.
When I do this
everything works fine. The program opens a small window and I can see the
status of my hardware.
However, if I start
the program from within rc.local, when the X server starts it refuses my
connection can puts this error message on the console:
Xlib: connection to
":0.0" refused by server
Xlib: No protocol
specified
It this error if I
use NULL, ":0.0", "::0.0", "localhost:0.0" or "unix:0.0" (I know, I know, this
is way old ;-). I did a few searches and found that this error is produced
by the X authorization code. It looks like if any hosts are authorized,
localhost is removed from the authorization list.
What I would like to
know is what is the difference between my program starting from rc.local vs from
a local user (root). Since I daemonize using the daemon() call, I should
no longer be associated with a tty, etc.
Anyone have an idea
how I can make this work?
Your help is
appreciated.
Take
care,
KJohn