Which of these 2 ways is the correct way to activate a service?

Hi friends.

Which of these 2 ways is the correct way to activate a service in EOS?

sudo systemctl start pcscd
sudo systemctl start --now pcscd.service

I’m following the steps in several guides, and some of them use the first one, and some the second one, so I don’t know which one is the correct one.

I also don’t know what exactly --now does, since without --now the service is supposed to be activated “now” as well.

Also, is it necessary to write the “.service”, or can it create problems if I don’t write it? (just curious, I don’t really care to put it)

I know that when I reboot EOS, I will have to run this command again in the terminal to re-enable it, that’s exactly what I want to do, so the service/process won’t be active if I don’t need it.

Thanks in advance friends.

EDIT:

I’m not sure now if it was start --now or enable --now. Anyway, I want to know what would be the way to put the start command, not the enable one.

1 Like

This will enable and start a service right away. The service remains enabled between reboots.

If you just need to start some.service for the current session:

sudo systemctl start some.service

is sufficient. The service will then remain disabled after reboot.

To stop it:

sudo systemctl stop some.service

For more: systemctl --help

For even more: man systemctl

Also:

https://wiki.archlinux.org/title/Systemd#Basic_systemctl_usage

3 Likes

You don’t have to unless you have several startable units having the same name and different types IIRC.

systemctl start --user gibberish Failed to start gibberish.service: Unit gibberish.service not found.

2 Likes

Thank you both so much!

I always forget to use the “man” and “–help” commands sorry!

Although I always search the Arch wiki, but I also wanted to be sure of breaking something important in EOS, and that’s why I preferred to make sure and opened the thread.

Now I understand everything, thanks again friends! :grinning:

3 Likes

great question. always wondered that too. I never know when ‘restart’ is appropriate either (vs. start). or ‘reload’ for that matter. gotta to be nuanced differences

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.