summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/readahead/sd-readahead.c3
-rw-r--r--units/systemd-readahead-collect.service.in2
-rw-r--r--units/systemd-readahead-replay.service.in1
3 files changed, 5 insertions, 1 deletions
diff --git a/src/readahead/sd-readahead.c b/src/readahead/sd-readahead.c
index a3340666dd..d48cd76807 100644
--- a/src/readahead/sd-readahead.c
+++ b/src/readahead/sd-readahead.c
@@ -57,7 +57,8 @@ static int touch(const char *path) {
mkdir("/run/systemd", 0755);
mkdir("/run/systemd/readahead", 0755);
- if ((fd = open(path, O_WRONLY|O_CREAT|O_CLOEXEC|O_NOCTTY, 0666)) < 0)
+ fd = open(path, O_WRONLY|O_CREAT|O_CLOEXEC|O_NOCTTY, 0666);
+ if (fd < 0)
return -errno;
for (;;) {
diff --git a/units/systemd-readahead-collect.service.in b/units/systemd-readahead-collect.service.in
index 7fe20d5c5c..6ad286b290 100644
--- a/units/systemd-readahead-collect.service.in
+++ b/units/systemd-readahead-collect.service.in
@@ -11,6 +11,8 @@ DefaultDependencies=no
Wants=systemd-readahead-done.timer
Conflicts=shutdown.target
Before=sysinit.target shutdown.target
+ConditionFileExists=!/run/systemd/readahead/cancel
+ConditionFileExists=!/run/systemd/readahead/done
ConditionVirtualization=no
[Service]
diff --git a/units/systemd-readahead-replay.service.in b/units/systemd-readahead-replay.service.in
index 6a101678c3..7324ba36c5 100644
--- a/units/systemd-readahead-replay.service.in
+++ b/units/systemd-readahead-replay.service.in
@@ -10,6 +10,7 @@ Description=Replay Read-Ahead Data
DefaultDependencies=no
Conflicts=shutdown.target
Before=sysinit.target shutdown.target
+ConditionPathExists=!/run/systemd/readahead/noreplay
ConditionPathExists=/.readahead
ConditionVirtualization=no