Score:2

What is the difference between an Autostart App and a system service?

ug flag

I'm working on creating an auto-start script that will launch & run my applications upon startup. I've created a .sh file that will run my applications but I've found 2 different ways I can run the file upon startup:

  1. create a .service file that will run my .sh script and add it to the systemctl services.

  2. use the "startup applications" app and add a .desktop file to my /.config/autostart folder that will run the .sh script upon startup.

I've tested both methods and they work well, but I am wondering what is the differences between the two & if one method is favored over the other?

petep avatar
in flag
the autostart app files will start with gnome gui login. systemd service start @boot
Score:2
cn flag
  1. System services (systemctl files) start before your login. They can run as any specified user or a non-human system user or root. They are headless (no window). They don't terminate when you logout.

  2. Startup Applications (Autostart directory) are part of your desktop environment. They start after you login. They run as you (your user). They usually use windows on your screen. They terminate when you logout.

You use them for different purposes.

  • If I want LibreOffice to open whenever I login, I add it to Startup Applications. Hints: It needs to use windows on my desktop. It won't be running headless while I am logged out.
  • If I want to run a webserver, it should be a system service. Hints: It should be running whenever the machine is turned on, regardless of whether I am logged in. It should run in the background, without any windows open.
Kyle avatar
ug flag
Thanks! Exactly the response I was hoping for. Definitely helps me choose which method to use.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.