1

I'd like to change the default target launched by systemd --user.

From ArchLinux wiki:

When systemd user instance starts, it brings up the target default.target

From man 7 systemd.special:

When systemd runs as a user instance, the following special units are available, which have similar definitions as their system counterparts: exit.target, default.target, shutdown.target, sockets.target, timers.target, paths.target, bluetooth.target, printer.target, smartcard.target, sound.target.

To change the system-wide default target, you can run systemctl set-default name. To change the default user target, you call systemctl --user set-default name.

The problem is, on what target should my custom target depend so that no other user-defined targets are broken? Obviously, depending on default.target doesn't help :)

0
$ cat /usr/lib/systemd/user/default.target
# ...
[Unit]
Description=Default
Documentation=man:systemd.special(7)
Requires=basic.target
After=basic.target
AllowIsolate=yes

So it seems depending on the basic.target should work. I did it and everything seems to work as it should. However, if you have any more insights, please, share them here :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.