I expected systemctl --user enable SERVICE
to start the service on login, which is not happening. Then what is it supposed to mean?
3 Answers
It makes the unit start on first login of a user, but for that corresponding unit file should have WantedBy = default.target
or something along the lines. Because when user instance of systemd
starts, it brings up the default.target
target.
-
My
chrome-remote-desktop.service
has[Install] / Alias=chromoting.service / WantedBy=default.target
, but I still have to start it manually on first login, any idea?– toklandJun 8, 2021 at 21:56 -
@tokland Have you enabled the service?
systemctl is-enabled chrome-remote-desktop
– x-yuriJun 9, 2021 at 4:00 -
-
1
systemctl --user enable SERVICE
will do nothing unless the related unit file has an [Install]
section. the [Install]
section lets systemd
know which symlinks to set up with enable
is used. From the docs:
Unit files may include an "[Install]" section, which carries installation information for the unit. This section is not interpreted by systemd(1) during runtime; it is used by the enable and disable commands of the systemctl(1) tool during installation of a unit.
systemd --user runs as a separate process from the systemd --system process. User units can not reference or depend on system units or units of other users.
Cannot have
After=network.target network-online.target
-
Is that first paragraph a quote? If so, what is it from? How does any of this answer the question? … … … … … … … … … … … … … … … … … … Please do not respond in comments; edit your answer to make it clearer and more complete. Jun 26, 2022 at 1:53
-
1As far as I can tell, this does not provide an answer to the question. Once you have sufficient reputation you will be able to comment on any post. - From Review Jun 26, 2022 at 1:53
-
As it’s currently written, your answer is unclear. Please edit to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers in the help center.– Community BotJul 4, 2022 at 15:42
arch linux
. Andsystemd
is the default since2012-10-13
. I installed my OS this summer. Does this answer your question?default.target
. I just copied the file as is and failed to realize that I've got yet to change the target.