I realise this may be more of a Linux question… however..
I have a Pi4 with the latest OS installed.
I’m using the Pi to display a vehicle dashboard with software called TS Dash. Its installed and working perfectly if I execute the TSDash.sh file from command line..
However, when I’ve created a .service file to launch it at startup I get this error:
pi@pi: S cat clock.log
Jar Name: TSDash.jar
Registration file not found.
03/04/2025, 21:25:18 : Debug: Unable to load user properties, looking in /home/pi/TSDash/.
The first section:
pi@pi: S cat clock.log
Jar Name: TSDash.jar
Is present when the software launches normally from command line. Its only the "registration file not found etc.. that appears when I try to use the service file.
This is the .service file I’m using:
I would nevertheless suggest that you use the standard xdg autostart mechanism to start GUI-programs. Inspect your autostart folders for blueprints. There is a system-wide folder somewhere below /etc, I think /etc/xdg/autostart, and a user-specific folder in your home-directory. I don’t have a running Pi up right now, but on my desktop it is $HOME/.config/autostart.
Thanks, I moved to the .service method when I failed to get it to run using the autostart method :)
My install of the Pi OS doesn’t have autostart folders, so I wondered if they had been depreciated.. I created my own /.config/autostart folders to try but could never get it to run and find that debugging autostarts isn’t easy.
When I get home later I’ll run a system search for /autostart folders as maybe they are not in the .config/ folders I was expecting.. I certainly did not look under the xdg folder as you suggest.
Oh yes, PiOS uses Wayfire on modern systems and openbox on older systems. Using find /etc/ -name autostart turns up a number of hits, one is /etc/xdg/openbox/autostart and a number of scripts below /etc/xdg/lxsession.
I don’t think that xdg is deprecated, but I am not sure that software developers (including those from the Pi-Foundation) are always aware of the standards.
But maybe the link from Stack Exchange already does what you want to do. Some feedback would be appreciated, since not everything that worked in the past still works.
If you are on the latest (bookworm) os you are probably using “labwc”, not X11. You can create a file called ~/.config/labwc/AUTOSTART
to start your script. This would insure the desktop was running before starting your script.
Services don’t run under you usercode unless specified. The path to the jar files may not be included in the default “$PATH”.