Autostart "script" doesn't work. How to debug?

Hi,

I tried to create an auto-start script:

$ cat /etc/xdg/autostart/81-openproject.desktop
[Desktop Entry]
Encoding=UTF-8
Type=Application
Name=81-openproject
Comment=Startet den OpenProject Server
Exec=/usr/bin/systemctl start docker; cd /var/www/openproject/compose; /usr/bin/docker-compose up -d
StartupNotify=false
Terminal=false
Hidden=false

It doens’t work. The openproject server isn’t running. I also created a bash alias

alias start-openproject="sudo systemctl start docker; cd /var/www/openproject/compose; sudo docker-compose up -d"

That works. So, I don’t know where the problem is and how to debug this. Any help appreciated.

Regards

Make sure it is executable: sudo chmod +x /etc/xdg/autostart/81-openproject.desktop. Also consider putting it in ~/.config/autostart. One more also that you can make this thing a systemd service and enable it.

You probably don’t need sudo anywhere in the alias.

*.desktop files should never be executable …

Since docker comes with a systemd service, why not enable it the proper way then?
systemctl enable docker.service

So, next reboot it will start … then you use only the needed command for whatever you want to achieve. (unclear to me at this point)

If it is intended to be launched only for your user, or if you are the single user, it may be more relevant indeed.
https://wiki.archlinux.org/title/XDG_Autostart

KDE asks me if a trust the file or not before running. But making the .desktop file executable removes that step. Anyway @xps you can go through this Docker - ArchWiki