Bug 66616 - swap.target in sysinit.target with After
Summary: swap.target in sysinit.target with After
Status: RESOLVED NOTABUG
Alias: None
Product: systemd
Classification: Unclassified
Component: general (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: systemd-bugs
QA Contact: systemd-bugs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-07-05 11:17 UTC by Harald Hoyer
Modified: 2013-09-12 17:43 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments

Description Harald Hoyer 2013-07-05 11:17:15 UTC
I removed "After=swap.target" from sysinit.target:

# systemd-delta 
[...]

[OVERRIDDEN] /etc/systemd/system/sysinit.target → /usr/lib/systemd/system/sysinit.target

--- /usr/lib/systemd/system/sysinit.target      2013-07-05 13:13:24.934943143 +0200
+++ /etc/systemd/system/sysinit.target  2013-07-05 11:01:50.829617792 +0200
@@ -10,5 +10,5 @@
 Documentation=man:systemd.special(7)
 Conflicts=emergency.service emergency.target
 Wants=local-fs.target swap.target
-After=local-fs.target swap.target emergency.service emergency.target
+After=local-fs.target emergency.service emergency.target
 RefuseManualStart=yes

[...]
# fgrep -r swap.target /lib/systemd/system /etc/systemd/system /run/systemd/
/lib/systemd/system/sysinit.target:Wants=local-fs.target swap.target
/lib/systemd/system/sysinit.target:After=local-fs.target swap.target emergency.service emergency.target
/etc/systemd/system/sysinit.target:Wants=local-fs.target swap.target
/run/systemd/generator/dev-disk-by\x2duuid-0a5847a8\x2d358d\x2d454f\x2dab98\x2d8592de5ca4ba.swap:Before=swap.target


BUT:

# systemctl show sysinit.target| fgrep swap.target
Wants=local-fs.target swap.target [...]
After=local-fs.target [...] swap.target [...]

It is still there! How come?
Comment 1 Lennart Poettering 2013-09-12 17:43:48 UTC
If DefaultDependencies= is on then all target units which have a wants= to another unit will get an after= to it as well, unless it already has a before=.

This is done so that it is sufficient to symlink a unit into a .wants/ directory of a target to get both an After= and a Wants= symlink.

To get rid of the After= set DEfaultDependencies=no in either of the targets (or set Before=).


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.