I am using Linux Mint 20.3 Cinnamon
$ systemctl --user get-default
default.target
$ ls -al /lib/systemd/system/default.target
lrwxrwxrwx 1 root 16 Jan 10 05:56 /lib/systemd/system/default.target -> graphical.target
$ \cat /lib/systemd/system/default.target
# SPDX-License-Identifier: LGPL-2.1+
#
# This file is part of systemd.
#
# systemd is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 2.1 of the License, or
# (at your option) any later version.
[Unit]
Description=Graphical Interface
Documentation=man:systemd.special(7)
Requires=multi-user.target
Wants=display-manager.service
Conflicts=rescue.service rescue.target
After=multi-user.target rescue.service rescue.target display-manager.service
AllowIsolate=yes
- I have
default.target
located in 2 different locations with different contents as follows:
$ \cat ~/.config/systemd/user/default.target
# SPDX-License-Identifier: LGPL-2.1+
#
# This file is part of systemd.
#
# systemd is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 2.1 of the License, or
# (at your option) any later version.
[Unit]
Description=Main User Target
Documentation=man:systemd.special(7)
Requires=basic.target
After=basic.target
AllowIsolate=yes
Question
- How to specify
/lib/systemd/system/default.target
inside a service unit file, for a user unit? - How to know which default target is used by a particular service unit file?
systemctl --user get-default
refers to which of these default.target?