[systemd-devel] [PATCH 2/4] Fix dependencies of triggers for the user manager
Giovanni Campagna
scampa.giovanni at gmail.com
Thu Dec 26 14:35:11 PST 2013
From: Giovanni Campagna <gcampagna at src.gnome.org>
Extend the build system to install .wants/ links for the user trigger
(socket, path, timer and busname) units too, and make sure they
are pulled in by default.target.
---
Makefile.am | 38 ++++++++++++++++++++++++--------------
units/user/default.target | 2 ++
2 files changed, 26 insertions(+), 14 deletions(-)
diff --git a/Makefile.am b/Makefile.am
index 162a7be..87f7558 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -219,8 +219,11 @@ LOCAL_FS_TARGET_WANTS =
MULTI_USER_TARGET_WANTS =
SYSINIT_TARGET_WANTS =
SOCKETS_TARGET_WANTS =
+USER_SOCKETS_TARGET_WANTS =
BUSNAMES_TARGET_WANTS =
+USER_BUSNAMES_TARGET_WANTS =
TIMERS_TARGET_WANTS =
+USER_TIMERS_TARGET_WANTS =
SYSTEM_UNIT_ALIASES =
USER_UNIT_ALIASES =
@@ -228,23 +231,30 @@ USER_UNIT_ALIASES =
GENERAL_ALIASES =
install-target-wants-hook:
- what="$(RUNLEVEL1_TARGET_WANTS)" && wants=runlevel1.target && $(add-wants)
- what="$(RUNLEVEL2_TARGET_WANTS)" && wants=runlevel2.target && $(add-wants)
- what="$(RUNLEVEL3_TARGET_WANTS)" && wants=runlevel3.target && $(add-wants)
- what="$(RUNLEVEL4_TARGET_WANTS)" && wants=runlevel4.target && $(add-wants)
- what="$(RUNLEVEL5_TARGET_WANTS)" && wants=runlevel5.target && $(add-wants)
- what="$(SHUTDOWN_TARGET_WANTS)" && wants=shutdown.target && $(add-wants)
- what="$(LOCAL_FS_TARGET_WANTS)" && wants=local-fs.target && $(add-wants)
- what="$(MULTI_USER_TARGET_WANTS)" && wants=multi-user.target && $(add-wants)
- what="$(SYSINIT_TARGET_WANTS)" && wants=sysinit.target && $(add-wants)
- what="$(SOCKETS_TARGET_WANTS)" && wants=sockets.target && $(add-wants)
- what="$(BUSNAMES_TARGET_WANTS)" && wants=busnames.target && $(add-wants)
- what="$(TIMERS_TARGET_WANTS)" && wants=timers.target && $(add-wants)
- what="$(SLICES_TARGET_WANTS)" && wants=slices.target && $(add-wants)
+ where=$(systemunitdir) && ( \
+ what="$(RUNLEVEL1_TARGET_WANTS)" && wants=runlevel1.target && $(add-wants); \
+ what="$(RUNLEVEL2_TARGET_WANTS)" && wants=runlevel2.target && $(add-wants); \
+ what="$(RUNLEVEL3_TARGET_WANTS)" && wants=runlevel3.target && $(add-wants); \
+ what="$(RUNLEVEL4_TARGET_WANTS)" && wants=runlevel4.target && $(add-wants); \
+ what="$(RUNLEVEL5_TARGET_WANTS)" && wants=runlevel5.target && $(add-wants); \
+ what="$(SHUTDOWN_TARGET_WANTS)" && wants=shutdown.target && $(add-wants); \
+ what="$(LOCAL_FS_TARGET_WANTS)" && wants=local-fs.target && $(add-wants); \
+ what="$(MULTI_USER_TARGET_WANTS)" && wants=multi-user.target && $(add-wants); \
+ what="$(SYSINIT_TARGET_WANTS)" && wants=sysinit.target && $(add-wants); \
+ what="$(SOCKETS_TARGET_WANTS)" && wants=sockets.target && $(add-wants); \
+ what="$(BUSNAMES_TARGET_WANTS)" && wants=busnames.target && $(add-wants); \
+ what="$(TIMERS_TARGET_WANTS)" && wants=timers.target && $(add-wants); \
+ what="$(SLICES_TARGET_WANTS)" && wants=slices.target && $(add-wants); \
+ )
+ where=$(userunitdir) && ( \
+ what="$(USER_SOCKETS_TARGET_WANTS)" && wants=sockets.target && $(add-wants); \
+ what="$(USER_BUSNAMES_TARGET_WANTS)" && wants=busnames.target && $(add-wants); \
+ what="$(USER_TIMERS_TARGET_WANTS)" && wants=timers.target && $(add-wants); \
+ )
define add-wants
[ -z "$$what" ] || ( \
- dir=$(DESTDIR)$(systemunitdir)/$$wants.wants && \
+ dir=$(DESTDIR)$$where/$$wants.wants && \
$(MKDIR_P) -m 0755 $$dir && \
cd $$dir && \
rm -f $$what && \
diff --git a/units/user/default.target b/units/user/default.target
index 71eed51..2a6ca65 100644
--- a/units/user/default.target
+++ b/units/user/default.target
@@ -8,4 +8,6 @@
[Unit]
Description=Default
Documentation=man:systemd.special(7)
+Wants=sockets.target timers.target paths.target busnames.target
+After=sockets.target timers.target paths.target busnames.target
AllowIsolate=yes
--
1.8.4.2
More information about the systemd-devel
mailing list