summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTom Gundersen <teg@jklm.no>2011-10-17 13:01:08 +0200
committerLennart Poettering <lennart@poettering.net>2011-11-01 23:42:41 +0100
commit87e75fddbb3701fd5f4e0d62dc1d661e8d94b071 (patch)
tree5b67507f992384cd4f95b3aeaac45ecdc59ff281 /src
parentfc8f0b5c9cb8277950a2fefdb7f754c47b172dfd (diff)
cryptsetup-generator: avoid ordering cycle on swap
Devices with random keys (swap), should not be ordered before local-fs.target, as this creates a cycle with systemd-load-random-seed.service (and also it does not make sense, a swap device is not a local-fs).
Diffstat (limited to 'src')
-rw-r--r--src/cryptsetup-generator.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/cryptsetup-generator.c b/src/cryptsetup-generator.c
index 6f3aa786bc..a48b7a4562 100644
--- a/src/cryptsetup-generator.c
+++ b/src/cryptsetup-generator.c
@@ -112,8 +112,7 @@ static int create_disk(
"DefaultDependencies=no\n"
"BindTo=%s dev-mapper-%%i.device\n"
"After=systemd-readahead-collect.service systemd-readahead-replay.service %s\n"
- "Before=umount.target\n"
- "Before=local-fs.target\n",
+ "Before=umount.target\n",
d, d);
if (!nofail)
@@ -125,6 +124,9 @@ static int create_disk(
streq(password, "/dev/hw_random")))
fprintf(f,
"After=systemd-random-seed-load.service\n");
+ else
+ fprintf(f,
+ "Before=local-fs.target\n");
fprintf(f,
"\n[Service]\n"