trouble trying to use xserver before gnome login
I have an application which must run at startup, without a user logging in, to manage this I have a user with limited permissions automatically logged on to tty7 and use sudo to run the application. I had this successfully configured once, but when trying to repeat the steps 'exactly' as before I'm running into trouble with the Xserver.
When I try running the application I get the message GTK-WARNING cannot open display. When I switch over to tty7 I see that neither DISPLAY nor Xauthority environmental variables are set.
I originally assumed this was due to not having authority to access the server. I don't know much about X server, but I have googled this and tried all the common suggestions. I've su to root and still can't access the program so the issue isn't with sudo, and I have tried creating an Xauthority file, setting Xauthority to look at root's xauth file, and changing the xhost settings. if I try running either the xhost + or xhost list commands I get errors that say unable to access display "" or display "0.0" (depending on if I try setting DISPLAY first).
I then tried hitting crtl alt f8 to switch back to the original login screen that came up when I booted up and logged in. When I switch to tty7 and run my app with sudo it works fine. So basically everything works so long as a user logs in to gnome, but if gnome isn't logged in I can't access the X server at all. I'm lead to assume that gnome starts something when it boots up that my application is using, or has the Xserver locked until it boots up? I'm suspecting that I'm doing something blatantly stupid here but I can't figure it out, and when I google I just find dozens of responses talking about setting Xhost permissions which I don't think is the problem...
so can someone either tell me what I'm missing or at least give me an idea where on what I should be googling to find the answers.
|