]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
nspawn: hook var-lib-machines.mount to machines.target and remote-fs.target
authorFelipe Sateler <fsateler@gmail.com>
Wed, 21 Jun 2017 20:04:38 +0000 (16:04 -0400)
committerFelipe Sateler <fsateler@gmail.com>
Wed, 21 Jun 2017 20:19:20 +0000 (16:19 -0400)
/var can be on a remote filesystem, thus hooking it to local-fs.target is not correct.

Also, only install the mount unit when machined is enabled, because
machined is the one managing the underlying device, and thus makes no
sense without machined.

Fixes #1175

Makefile.am
units/meson.build

index 3b9ed874e5d7cf11a5f48f92e786b98277d58e8b..07b425eab83fe3e2d1fe4d6dd3da76331b671a47 100644 (file)
@@ -269,8 +269,10 @@ INSTALL_DIRS =
 
 SHUTDOWN_TARGET_WANTS =
 LOCAL_FS_TARGET_WANTS =
+REMOTE_FS_TARGET_WANTS =
 MULTI_USER_TARGET_WANTS =
 GRAPHICAL_TARGET_WANTS =
+MACHINES_TARGET_WANTS =
 RESCUE_TARGET_WANTS =
 SYSINIT_TARGET_WANTS =
 SOCKETS_TARGET_WANTS =
@@ -287,6 +289,8 @@ GENERAL_ALIASES =
 install-target-wants-hook:
        what="$(SHUTDOWN_TARGET_WANTS)" && wants=shutdown.target && dir=$(systemunitdir) && $(add-wants)
        what="$(LOCAL_FS_TARGET_WANTS)" && wants=local-fs.target && dir=$(systemunitdir) && $(add-wants)
+       what="$(REMOTE_FS_TARGET_WANTS)" && wants=remote-fs.target && dir=$(systemunitdir) && $(add-wants)
+       what="$(MACHINES_TARGET_WANTS)" && wants=machines.target && dir=$(systemunitdir) && $(add-wants)
        what="$(MULTI_USER_TARGET_WANTS)" && wants=multi-user.target && dir=$(systemunitdir) && $(add-wants)
        what="$(GRAPHICAL_TARGET_WANTS)" && wants=graphical.target && dir=$(systemunitdir) && $(add-wants)
        what="$(RESCUE_TARGET_WANTS)" && wants=rescue.target && dir=$(systemunitdir) && $(add-wants)
@@ -539,7 +543,6 @@ dist_systemunit_DATA = \
        units/sys-kernel-debug.mount \
        units/sys-fs-fuse-connections.mount \
        units/tmp.mount \
-       units/var-lib-machines.mount \
        units/printer.target \
        units/sound.target \
        units/bluetooth.target \
@@ -5322,6 +5325,10 @@ endif
 
 # ------------------------------------------------------------------------------
 if ENABLE_MACHINED
+
+dist_systemunit_DATA += \
+       units/var-lib-machines.mount
+
 systemd_machined_SOURCES = \
        src/machine/machined.c \
        src/machine/machined.h
@@ -6568,7 +6575,9 @@ SYSINIT_TARGET_WANTS += \
 
 LOCAL_FS_TARGET_WANTS += \
        systemd-remount-fs.service \
-       tmp.mount \
+       tmp.mount
+
+REMOTE_FS_TARGET_WANTS += \
        var-lib-machines.mount
 
 MULTI_USER_TARGET_WANTS += \
@@ -6584,6 +6593,11 @@ SYSINIT_TARGET_WANTS += \
        systemd-sysctl.service \
        systemd-ask-password-console.path
 
+if ENABLE_MACHINED
+MACHINES_TARGET_WANTS += \
+       var-lib-machines.mount
+endif
+
 if HAVE_SYSV_COMPAT
 SYSTEM_UNIT_ALIASES += \
        poweroff.target runlevel0.target \
index 6fb1fa29c9b15d56a350b066003010658250bd86..e94add6a6f2f768c44f8de65cc1f935454d24354 100644 (file)
@@ -101,8 +101,8 @@ units = [
         ['timers.target',                       ''],
         ['umount.target',                       ''],
         ['user.slice',                          ''],
-        ['var-lib-machines.mount',              '',
-         'local-fs.target.wants/'],
+        ['var-lib-machines.mount',              'ENABLE_MACHINED',
+         'remote-fs.target.wants/ machines.target.wants/'],
 ]
 
 in_units = [