Page 1 of 1

Linux Console app causing "cannot open display:" error

Posted: Wed Apr 01, 2020 4:54 pm
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

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

Posted: Wed Apr 01, 2020 5:31 pm
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.

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

Posted: Wed Apr 01, 2020 9:07 pm
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

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

Posted: Fri Apr 03, 2020 2:08 pm
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