summaryrefslogtreecommitdiff
path: root/pcr/elogind/elogind-219.12-runtime.patch
blob: f14806c3164d8d58eeb404362b96d8d420a3cf8c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
From 276746896985c438d317fcae414e9c83a6dd3d76 Mon Sep 17 00:00:00 2001
From: Sven Eden <yamakuzure@gmx.net>
Date: Fri, 20 Jan 2017 17:14:35 +0100
Subject: [PATCH] Create /run/systemd as needed

* src/login/logind.c (main): Also create /run/systemd at startup.
* Create /run/systemd/machines, so that the login monitor works.
* Fail if any of the needed directories could not be created.
* But do not fail if any of the needed directories exist.
---
 src/login/logind.c | 18 +++++++++++++++---
 1 file changed, 15 insertions(+), 3 deletions(-)

diff --git a/src/login/logind.c b/src/login/logind.c
index 1ab50ec..07a77b1 100644
--- a/src/login/logind.c
+++ b/src/login/logind.c
@@ -1131,10 +1131,21 @@ int main(int argc, char *argv[]) {
          * existence of /run/systemd/seats/ to determine whether
          * logind is available, so please always make sure this check
          * stays in. */
-        mkdir_label("/run/systemd/seats", 0755);
-        mkdir_label("/run/systemd/users", 0755);
-        mkdir_label("/run/systemd/sessions", 0755);
-        mkdir_label("/run/systemd/machines", 0755);
+        r = mkdir_label("/run/systemd", 0755);
+        if ( (r < 0) && (-EEXIST != r) )
+                return log_error_errno(r, "Failed to create /run/systemd : %m");
+        r = mkdir_label("/run/systemd/seats", 0755);
+        if ( r < 0 && (-EEXIST != r) )
+                return log_error_errno(r, "Failed to create /run/systemd/seats : %m");
+        r = mkdir_label("/run/systemd/users", 0755);
+        if ( r < 0 && (-EEXIST != r) )
+                return log_error_errno(r, "Failed to create /run/systemd/users : %m");
+        r = mkdir_label("/run/systemd/sessions", 0755);
+        if ( r < 0 && (-EEXIST != r) )
+                return log_error_errno(r, "Failed to create /run/systemd/sessions : %m");
+        r = mkdir_label("/run/systemd/machines", 0755);
+        if ( r < 0 && (-EEXIST != r) )
+                return log_error_errno(r, "Failed to create /run/systemd/machines : %m");
 
         m = manager_new();
         if (!m) {