units: install user units as real files, not symlinks to ../system/

This was causing preset-all --global to create symlinks:

$ systemctl preset-all --global --root=/var/tmp/inst1
Created symlink /var/tmp/inst1/etc/systemd/user/shutdown.target → /usr/lib/systemd/user/../system/shutdown.target.
Created symlink /var/tmp/inst1/etc/systemd/user/sockets.target → /usr/lib/systemd/user/../system/sockets.target.
Created symlink /var/tmp/inst1/etc/systemd/user/timers.target → /usr/lib/systemd/user/../system/timers.target.
Created symlink /var/tmp/inst1/etc/systemd/user/paths.target → /usr/lib/systemd/user/../system/paths.target.
Created symlink /var/tmp/inst1/etc/systemd/user/bluetooth.target → /usr/lib/systemd/user/../system/bluetooth.target.
Created symlink /var/tmp/inst1/etc/systemd/user/printer.target → /usr/lib/systemd/user/../system/printer.target.
Created symlink /var/tmp/inst1/etc/systemd/user/sound.target → /usr/lib/systemd/user/../system/sound.target.
Created symlink /var/tmp/inst1/etc/systemd/user/smartcard.target → /usr/lib/systemd/user/../system/smartcard.target.
Created symlink /var/tmp/inst1/etc/systemd/user/busnames.target → /usr/lib/systemd/user/../system/busnames.target.

It is better to create units in a state that completely matches the presets, i.e.
preset-all should do nothing when invoked immediately after installation.

I'm sure it was confusing to users too, suggesting that system and user units
may somehow alias each other.
This commit is contained in:
Zbigniew Jędrzejewski-Szmek 2016-08-13 10:09:11 -04:00
parent 0064dcc0fc
commit de78fa9ba0
10 changed files with 19 additions and 14 deletions

View File

@ -575,7 +575,16 @@ dist_userunit_DATA = \
units/user/default.target \
units/user/exit.target \
units/user/graphical-session.target \
units/user/graphical-session-pre.target
units/user/graphical-session-pre.target \
units/user/bluetooth.target \
units/user/busnames.target \
units/user/paths.target \
units/user/printer.target \
units/user/shutdown.target \
units/user/smartcard.target \
units/user/sockets.target \
units/user/sound.target \
units/user/timers.target
nodist_userunit_DATA = \
units/user/systemd-exit.service
@ -6296,19 +6305,6 @@ SYSTEM_UNIT_ALIASES += \
reboot.target ctrl-alt-del.target \
getty@.service autovt@.service
USER_UNIT_ALIASES += \
$(systemunitdir)/shutdown.target shutdown.target \
$(systemunitdir)/sockets.target sockets.target \
$(systemunitdir)/timers.target timers.target \
$(systemunitdir)/paths.target paths.target \
$(systemunitdir)/bluetooth.target bluetooth.target \
$(systemunitdir)/printer.target printer.target \
$(systemunitdir)/sound.target sound.target \
$(systemunitdir)/smartcard.target smartcard.target
USER_UNIT_ALIASES += \
$(systemunitdir)/busnames.target busnames.target
GENERAL_ALIASES += \
$(systemunitdir)/remote-fs.target $(pkgsysconfdir)/system/multi-user.target.wants/remote-fs.target \
$(systemunitdir)/getty@.service $(pkgsysconfdir)/system/getty.target.wants/getty@tty1.service \

1
units/user/bluetooth.target Symbolic link
View File

@ -0,0 +1 @@
../bluetooth.target

1
units/user/busnames.target Symbolic link
View File

@ -0,0 +1 @@
../busnames.target

1
units/user/paths.target Symbolic link
View File

@ -0,0 +1 @@
../paths.target

1
units/user/printer.target Symbolic link
View File

@ -0,0 +1 @@
../printer.target

1
units/user/shutdown.target Symbolic link
View File

@ -0,0 +1 @@
../shutdown.target

1
units/user/smartcard.target Symbolic link
View File

@ -0,0 +1 @@
../smartcard.target

1
units/user/sockets.target Symbolic link
View File

@ -0,0 +1 @@
../sockets.target

1
units/user/sound.target Symbolic link
View File

@ -0,0 +1 @@
../sound.target

1
units/user/timers.target Symbolic link
View File

@ -0,0 +1 @@
../timers.target