Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 8044

Beginners • Re: Running a program at startup

$
0
0
The best way around that is simply to have the autorun execute a shell script that checks for the necessary pre-conditions and waits before executing themain command . A fixed delay may fail if one of the items (eg the network interface) takes longer than usual to become available.

Nope. The best way is a systemd service with appropriate dependencies. Probably combined with mounting the USB drive via /etc/fstab rather thanrelying on the desktop's automounter (the automounter can mount the same drive in a different location).

And adapt your code to handle exceptions rather than just crashing.
Anyway, we digress ... hopefully, someone will fix the incorrect sticky ...

Are you referring to the sticky with my guide in it? If so, it's on my todo list and will be done as time, energy, and ongoing PC issues permit. Comments like yours will not encourage action on my part. Rather the opposite in fact.

All methods in that guide work on the systems as detailed. The switch to wayland with wayfire means the X11 related section does not apply. The recent switch to wayland with labwc means the wayfire stuff no longer applies. However AIUI labwc uses the same autostart syntax as lxde so, if you can the correct file(s) that approach should work.

Or use raspi-config to switch to X11/lxde

Many other methods (including $HOME/.config/autostart) are covered in there too.

Statistics: Posted by thagrol — Mon Nov 11, 2024 1:54 pm



Viewing all articles
Browse latest Browse all 8044

Trending Articles