I need this patch in order to avoid cycles during boot. It looks to me that others should be hit by the same problem (but I have not heard anyone complain, so I might be wrong):
A .mount unit (e.g. home.mount) will have dependencies After=fsck.target and Before=local-fs.target, this will give the following chain: sysinit.target -> systemd-random-seed-load.service -> local-fs.target -> home.mount -> fsck.target If fsck.target is an alias for sysinit.target this is a cycle. We avoid that by splitting them into two separate units and making local-fs.target want fsck.target. Cheers, Tom
From 09783847bf8a9da8594e53038058db103169895c Mon Sep 17 00:00:00 2001 From: Tom Gundersen <t...@jklm.no> Date: Thu, 23 Sep 2010 18:15:26 +0200 Subject: [PATCH] units: split fsck.target from sysinit.target A .mount unit (e.g. home.mount) will have dependencies After=fsck.target and Before=local-fs.target, this will give the following chain: sysinit.target -> systemd-random-seed-load.service -> local-fs.target -> home.mount -> fsck.target If fsck.target is an alias for sysinit.target this is a cycle. We avoid that by splitting them into two separate units and making local-fs.target want fsck.target. --- Makefile.am | 13 +++---------- units/debian/fsck.target | 11 ----------- units/fsck.target | 11 +++++++++++ units/fsck.target.m4 | 22 ++++++++++++++++++++++ units/local-fs.target | 1 + units/suse/fsck.target | 11 ----------- units/sysinit.target.m4 | 6 ------ 7 files changed, 37 insertions(+), 38 deletions(-) delete mode 100644 units/debian/fsck.target create mode 100644 units/fsck.target create mode 100644 units/fsck.target.m4 delete mode 100644 units/suse/fsck.target diff --git a/Makefile.am b/Makefile.am index 2cd3deb..42b9199 100644 --- a/Makefile.am +++ b/Makefile.am @@ -192,6 +192,7 @@ dist_systemunit_DATA = \ nodist_systemunit_DATA = \ units/sysinit.target \ + units/fsck.target \ units/ge...@.service \ units/serial-ge...@.service \ units/graphical.target \ @@ -219,6 +220,7 @@ nodist_sessionunit_DATA = \ EXTRA_DIST = \ units/sysinit.target.m4 \ + units/fsck.target.m4 \ units/ge...@.service.m4 \ units/serial-ge...@.service.m4 \ units/graphical.target.m4 \ @@ -261,7 +263,6 @@ dist_systemunit_DATA += \ units/debian/killall.service \ units/debian/poweroff.service \ units/debian/reboot.service \ - units/debian/fsck.target \ units/debian/umountfs.service \ units/debian/umountnfs.service \ units/debian/umountroot.service @@ -271,8 +272,7 @@ if TARGET_SUSE dist_systemunit_DATA += \ units/suse/halt.service \ units/suse/poweroff.service \ - units/suse/reboot.service \ - units/suse/fsck.target + units/suse/reboot.service endif if TARGET_GENTOO @@ -1100,13 +1100,6 @@ if TARGET_DEBIAN rm -f runlevel5.target && \ $(LN_S) multi-user.target runlevel5.target ) endif -if !TARGET_SUSE -if !TARGET_DEBIAN - ( cd $(DESTDIR)$(systemunitdir) && \ - rm -f fsck.target && \ - $(LN_S) sysinit.target fsck.target ) -endif -endif DISTCHECK_CONFIGURE_FLAGS = \ --with-dbuspolicydir=$$dc_install_base/$(dbuspolicydir) \ diff --git a/units/debian/fsck.target b/units/debian/fsck.target deleted file mode 100644 index 5da9a4f..0000000 --- a/units/debian/fsck.target +++ /dev/null @@ -1,11 +0,0 @@ -# This file is part of systemd. -# -# systemd is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. - -# See systemd.special(7) for details - -[Unit] -Description=File System Check diff --git a/units/fsck.target b/units/fsck.target new file mode 100644 index 0000000..5da9a4f --- /dev/null +++ b/units/fsck.target @@ -0,0 +1,11 @@ +# This file is part of systemd. +# +# systemd is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. + +# See systemd.special(7) for details + +[Unit] +Description=File System Check diff --git a/units/fsck.target.m4 b/units/fsck.target.m4 new file mode 100644 index 0000000..7d44763 --- /dev/null +++ b/units/fsck.target.m4 @@ -0,0 +1,22 @@ +# This file is part of systemd. +# +# systemd is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. + +# See systemd.special(7) for details + +[Unit] +Description=File System Check +m4_dnl +m4_ifdef(`TARGET_FEDORA', +m4_dnl Hook in Fedora's /etc/rc.d/rc.sysinit +Requires=sysinit.service +After=sysinit.service +)m4_dnl +m4_ifdef(`TARGET_ARCH', +m4_dnl Hook in Arch's /etc/rc.sysinit +Requires=sysinit.service +After=sysinit.service +)m4_dnl diff --git a/units/local-fs.target b/units/local-fs.target index 52d0e68..869ab9f 100644 --- a/units/local-fs.target +++ b/units/local-fs.target @@ -9,3 +9,4 @@ [Unit] Description=Local File Systems +Wants=fsck.target diff --git a/units/suse/fsck.target b/units/suse/fsck.target deleted file mode 100644 index 5da9a4f..0000000 --- a/units/suse/fsck.target +++ /dev/null @@ -1,11 +0,0 @@ -# This file is part of systemd. -# -# systemd is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. - -# See systemd.special(7) for details - -[Unit] -Description=File System Check diff --git a/units/sysinit.target.m4 b/units/sysinit.target.m4 index e8d4d72..08b035d 100644 --- a/units/sysinit.target.m4 +++ b/units/sysinit.target.m4 @@ -23,9 +23,3 @@ m4_dnl Hook in Arch's /etc/rc.sysinit Requires=sysinit.service After=sysinit.service )m4_dnl -m4_ifdef(`TARGET_SUSE',`', -m4_ifdef(`TARGET_DEBIAN',`', -m4_dnl On Suse and Debian fsck.target is separate, everywhere else it is just an alias for sysinit.target -Names=fsck.target -)m4_dnl -)m4_dnl -- 1.7.3
_______________________________________________ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel