Good timing to start a non-GUI program on OS boot-up

Questions about Wine on Linux
Post Reply
tomonori.manome
Newbie
Newbie
Posts: 3
Joined: Wed Jul 22, 2020 12:03 am
Location: Kyoto, Japan

Good timing to start a non-GUI program on OS boot-up

Post by tomonori.manome » Wed Jan 06, 2021 1:56 am

Hello,

I'm trying to start a non-GUI program on OS boot up and before GDM user logon.
(I am using GNOME based RHEL 8. My purpose is start a WINE based .NET program in a remote location such as factories.)

When I start the program with a shell script for chkconfig command.
The program itself worked correctly.
(Memo: I used "sudo -u <user> <command>" shell command to start the program with an user privilege.)

But when I start a GUI-based wine program after the logon via GNOME(gdm),
It displays the following message and failed.

Code: Select all

$ winecfg
0150:err:winediag:nodrv_CreateWindow Application tried to create a window, but no driver could be loaded.
0150:err:winediag:nodrv_CreateWindow Make sure that your X server is running and that $DISPLAY is set correctly.
I also confirmed "$ wine notepad.exe". It failed and displayed the same message.

I'd appreciate if somebody could give me an advice to start a non-GUI wine program on OS boot-up
before GNOME user login and still keep the functionality of GUI-based wine programs.

Are these methods considered possible?
1) Editing gdm.conf and register a shell script for pre-session.
2) Start the target program after gdm process run by systemd.
3) Before starting the non-GUI program, set DISPLAY variable manually.

I found a workaround that is to enable autologin and register the non-GUI program into the GNOME
startup applications and register the screen lock program also for password lock.
But if possible I would like to take a way not depending on the autologin for ease of user operation.

Reference:
I found the following topic and I recognize wine program requires running X server.
viewtopic.php?t=2491

Sincerely,

--
Tomonori Manome

jkfloris
Level 9
Level 9
Posts: 1274
Joined: Thu Aug 14, 2014 10:10 am

Re: Good timing to start a non-GUI program on OS boot-up

Post by jkfloris » Wed Jan 06, 2021 5:10 pm

I don't know if it applies in your case, but you can make a different Wineprefix for both cases.
For example, start the non-GUI program with:
WINEPREFIX=~/.non-GUI-wine wine program.exe
and you can start the GUI-based wine with the default Wineprefix:
wine program.exe

tomonori.manome
Newbie
Newbie
Posts: 3
Joined: Wed Jul 22, 2020 12:03 am
Location: Kyoto, Japan

Re: Good timing to start a non-GUI program on OS boot-up

Post by tomonori.manome » Thu Jan 07, 2021 2:54 am

Hello, Thank you for your helpful advice.
For my case, it is necessary to share the saved setting information among non-GUI program and another custom GUI program. (Sorry I forgot to mention it.)

I re-checked GNOME gdm manual and found an another idea. If I start the wine program from /etc/gdm/Init with user priviledge, both non-GUI program and GUI program may work.
I will keep trying several ideas. Thanks again for your idea because I could re-think several possiblities.

Sincerely,

--
Tomonori Manome

Post Reply