chiark / gitweb /
relicense to LGPLv2.1 (with exceptions)
[elogind.git] / src / path-lookup.c
index e1925f1a4d54e4fb5ca328c6bf7e1cbd5170f77a..1d95f7d1f83f5b4c64305e108366d7c430f8f45a 100644 (file)
@@ -6,16 +6,16 @@
   Copyright 2010 Lennart Poettering
 
   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
+  under the terms of the GNU Lesser General Public License as published by
+  the Free Software Foundation; either version 2.1 of the License, or
   (at your option) any later version.
 
   systemd is distributed in the hope that it will be useful, but
   WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-  General Public License for more details.
+  Lesser General Public License for more details.
 
-  You should have received a copy of the GNU General Public License
+  You should have received a copy of the GNU Lesser General Public License
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
@@ -26,6 +26,7 @@
 #include <errno.h>
 
 #include "util.h"
+#include "mkdir.h"
 #include "strv.h"
 
 #include "path-lookup.h"
@@ -54,9 +55,10 @@ int user_config_home(char **config_home) {
 
 static char** user_dirs(void) {
         const char * const config_unit_paths[] = {
-                "/run/systemd/user",
                 USER_CONFIG_UNIT_PATH,
-                "/etc/systemd/user"
+                "/etc/systemd/user",
+                "/run/systemd/user",
+                NULL
         };
 
         const char * const data_unit_paths[] = {
@@ -64,7 +66,8 @@ static char** user_dirs(void) {
                 "/usr/local/share/systemd/user",
                 USER_DATA_UNIT_PATH,
                 "/usr/lib/systemd/user",
-                "/usr/share/systemd/user"
+                "/usr/share/systemd/user",
+                NULL
         };
 
         const char *home, *e;
@@ -205,9 +208,9 @@ int lookup_paths_init(LookupPaths *p, ManagerRunningAs running_as, bool personal
                                                 /* If you modify this you also want to modify
                                                  * systemduserunitpath= in systemd.pc.in, and
                                                  * the arrays in user_dirs() above! */
-                                                "/run/systemd/user",
                                                 USER_CONFIG_UNIT_PATH,
-                                                "/etc/systemd/system",
+                                                "/etc/systemd/user",
+                                                "/run/systemd/user",
                                                 "/usr/local/lib/systemd/user",
                                                 "/usr/local/share/systemd/user",
                                                 USER_DATA_UNIT_PATH,
@@ -222,13 +225,15 @@ int lookup_paths_init(LookupPaths *p, ManagerRunningAs running_as, bool personal
                         if (!(p->unit_path = strv_new(
                                               /* If you modify this you also want to modify
                                                * systemdsystemunitpath= in systemd.pc.in! */
-                                              "/run/systemd/system",
                                               SYSTEM_CONFIG_UNIT_PATH,
                                               "/etc/systemd/system",
+                                              "/run/systemd/system",
                                               "/usr/local/lib/systemd/system",
-                                              "/usr/lib/systemd/system",
                                               SYSTEM_DATA_UNIT_PATH,
+                                              "/usr/lib/systemd/system",
+#ifdef HAVE_SPLIT_USR
                                               "/lib/systemd/system",
+#endif
                                               NULL)))
                                 return -ENOMEM;
         }