Linux Console app causing "cannot open display:" error

Linux specific forum
swhite
Enthusiast
Enthusiast
Posts: 727
Joined: Thu May 21, 2009 6:56 pm

Linux Console app causing "cannot open display:" error

Post by swhite »

Hi Fred

My issue is that I want to print documents from Linux daemon. The daemon simply listens on a TCP port for a document request and then prints the document to the default printer. I built a Linux console app in PB 5.71 and the daemon works fine as long as the user is logged into the Linux PC. However, the daemon will not start if you re-boot the PC and then never login.

Can you tell me whether this something PureBasic is causing or whether it is the result of an underlying Linux library used by Purebasic? If it is an underlying library can you tell me which one as I would like to contact the developers to see if the issue can be fixed.

Thanks,
Simon
Simon White
dCipher Computing
User avatar
mk-soft
Always Here
Always Here
Posts: 5389
Joined: Fri May 12, 2006 6:51 pm
Location: Germany

Re: Linux Console app causing "cannot open display:" error

Post by mk-soft »

I think is not a Bug...

I assume that the application runs under a wrong authorization.
Only when the user has also logged on, the application can run.

But I also don't know how to get an application to run under another authorization.
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
swhite
Enthusiast
Enthusiast
Posts: 727
Joined: Thu May 21, 2009 6:56 pm

Re: Linux Console app causing "cannot open display:" error

Post by swhite »

mk-soft wrote:I think is not a Bug...

I assume that the application runs under a wrong authorization.
Only when the user has also logged on, the application can run.

But I also don't know how to get an application to run under another authorization.
This daemon works perfectly as long as I do not include any code using SVG for printing. In fact it has been working for several years. The problem began when I added the ability to print to the default printer using SVG. Now it will only run if the user is logged in whereas before it always ran regardless of whether a user logged in. So there is something in the graphics library checking for a display. However my PB application never uses a display.

Simon
Simon White
dCipher Computing
swhite
Enthusiast
Enthusiast
Posts: 727
Joined: Thu May 21, 2009 6:56 pm

Re: Linux Console app causing "cannot open display:" error

Post by swhite »

Hi

I would still like to know what the real issue with this problem but for the time being I solved it by creating a second user with an automatic login and then added:

Code: Select all

    nohup /home/remote/KardTech/FusionPro/dcfusnblad &
to the .bashrc file of the second user. Now the dcfusnblad executable runs and prints forms as expected.

Simon
Simon White
dCipher Computing
Post Reply