chiark / gitweb /
manager: identify the init/system/user mode we are running it and pick D-Bus bus...
[elogind.git] / load-fragment.c
index 4bb1ef0108d5371f76915e6c0c293befcfc029e9..95e6cc3f88aa18833713d9d7a9b60bcc92108601 100644 (file)
@@ -1,5 +1,24 @@
 /*-*- Mode: C; c-basic-offset: 8 -*-*/
 
+/***
+  This file is part of systemd.
+
+  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
+  (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.
+
+  You should have received a copy of the GNU General Public License
+  along with systemd; If not, see <http://www.gnu.org/licenses/>.
+***/
+
 #include <linux/oom.h>
 #include <assert.h>
 #include <errno.h>
@@ -266,7 +285,7 @@ static int config_parse_oom_adjust(
         return 0;
 }
 
-static int config_parse_umask(
+static int config_parse_mode(
                 const char *filename,
                 unsigned line,
                 const char *section,
@@ -287,12 +306,12 @@ static int config_parse_umask(
         errno = 0;
         l = strtol(rvalue, &x, 8);
         if (!x || *x || errno) {
-                log_error("[%s:%u] Failed to parse umask value: %s", filename, line, rvalue);
+                log_error("[%s:%u] Failed to parse mode value: %s", filename, line, rvalue);
                 return errno ? -errno : -EINVAL;
         }
 
-        if (l < 0000 || l > 0777) {
-                log_error("[%s:%u] umask value out of range: %s", filename, line, rvalue);
+        if (l < 0000 || l > 07777) {
+                log_error("[%s:%u] mode value out of range: %s", filename, line, rvalue);
                 return -ERANGE;
         }
 
@@ -453,7 +472,7 @@ static int config_parse_service_restart(
         return 0;
 }
 
-int config_parse_bindtodevice(
+static int config_parse_bindtodevice(
                 const char *filename,
                 unsigned line,
                 const char *section,
@@ -482,7 +501,7 @@ int config_parse_bindtodevice(
         return 0;
 }
 
-int config_parse_output(
+static int config_parse_output(
                 const char *filename,
                 unsigned line,
                 const char *section,
@@ -508,7 +527,7 @@ int config_parse_output(
         return 0;
 }
 
-int config_parse_input(
+static int config_parse_input(
                 const char *filename,
                 unsigned line,
                 const char *section,
@@ -534,7 +553,7 @@ int config_parse_input(
         return 0;
 }
 
-int config_parse_facility(
+static int config_parse_facility(
                 const char *filename,
                 unsigned line,
                 const char *section,
@@ -564,7 +583,7 @@ int config_parse_facility(
         return 0;
 }
 
-int config_parse_level(
+static int config_parse_level(
                 const char *filename,
                 unsigned line,
                 const char *section,
@@ -593,7 +612,7 @@ int config_parse_level(
         return 0;
 }
 
-int config_parse_io_class(
+static int config_parse_io_class(
                 const char *filename,
                 unsigned line,
                 const char *section,
@@ -624,7 +643,7 @@ int config_parse_io_class(
         return 0;
 }
 
-int config_parse_io_priority(
+static int config_parse_io_priority(
                 const char *filename,
                 unsigned line,
                 const char *section,
@@ -652,7 +671,7 @@ int config_parse_io_priority(
         return 0;
 }
 
-int config_parse_cpu_sched_policy(
+static int config_parse_cpu_sched_policy(
                 const char *filename,
                 unsigned line,
                 const char *section,
@@ -684,7 +703,7 @@ int config_parse_cpu_sched_policy(
         return 0;
 }
 
-int config_parse_cpu_sched_prio(
+static int config_parse_cpu_sched_prio(
                 const char *filename,
                 unsigned line,
                 const char *section,
@@ -713,7 +732,7 @@ int config_parse_cpu_sched_prio(
         return 0;
 }
 
-int config_parse_cpu_affinity(
+static int config_parse_cpu_affinity(
                 const char *filename,
                 unsigned line,
                 const char *section,
@@ -756,7 +775,7 @@ int config_parse_cpu_affinity(
         return 0;
 }
 
-int config_parse_capabilities(
+static int config_parse_capabilities(
                 const char *filename,
                 unsigned line,
                 const char *section,
@@ -788,7 +807,7 @@ int config_parse_capabilities(
         return 0;
 }
 
-int config_parse_secure_bits(
+static int config_parse_secure_bits(
                 const char *filename,
                 unsigned line,
                 const char *section,
@@ -829,7 +848,7 @@ int config_parse_secure_bits(
         return 0;
 }
 
-int config_parse_bounding_set(
+static int config_parse_bounding_set(
                 const char *filename,
                 unsigned line,
                 const char *section,
@@ -1024,8 +1043,9 @@ static int load_from_path(Unit *u, const char *path) {
                 { "IOSchedulingPriority",   config_parse_io_priority,     &(context),                                      section   }, \
                 { "CPUSchedulingPolicy",    config_parse_cpu_sched_policy,&(context),                                      section   }, \
                 { "CPUSchedulingPriority",  config_parse_cpu_sched_prio,  &(context),                                      section   }, \
+                { "CPUSchedulingResetOnFork", config_parse_bool,          &(context).cpu_sched_reset_on_fork,              section   }, \
                 { "CPUAffinity",            config_parse_cpu_affinity,    &(context),                                      section   }, \
-                { "UMask",                  config_parse_umask,           &(context).umask,                                section   }, \
+                { "UMask",                  config_parse_mode,            &(context).umask,                                section   }, \
                 { "Environment",            config_parse_strv,            &(context).environment,                          section   }, \
                 { "Output",                 config_parse_output,          &(context).output,                               section   }, \
                 { "Input",                  config_parse_input,           &(context).input,                                section   }, \
@@ -1051,7 +1071,8 @@ static int load_from_path(Unit *u, const char *path) {
                 { "LimitMSGQUEUE",          config_parse_limit,           &(context).rlimit[RLIMIT_MSGQUEUE],              section   }, \
                 { "LimitNICE",              config_parse_limit,           &(context).rlimit[RLIMIT_NICE],                  section   }, \
                 { "LimitRTPRIO",            config_parse_limit,           &(context).rlimit[RLIMIT_RTPRIO],                section   }, \
-                { "LimitRTTIME",            config_parse_limit,           &(context).rlimit[RLIMIT_RTTIME],                section   }
+                { "LimitRTTIME",            config_parse_limit,           &(context).rlimit[RLIMIT_RTTIME],                section   }, \
+                { "NonBlocking",            config_parse_bool,            &(context).non_blocking,                         section   }
 
         const ConfigItem items[] = {
                 { "Names",                  config_parse_names,           u,                                               "Meta"    },
@@ -1091,6 +1112,8 @@ static int load_from_path(Unit *u, const char *path) {
                 { "ExecStartPost",          config_parse_exec,            u->socket.exec_command+SOCKET_EXEC_START_POST,   "Socket"  },
                 { "ExecStopPre",            config_parse_exec,            u->socket.exec_command+SOCKET_EXEC_STOP_PRE,     "Socket"  },
                 { "ExecStopPost",           config_parse_exec,            u->socket.exec_command+SOCKET_EXEC_STOP_POST,    "Socket"  },
+                { "DirectoryMode",          config_parse_mode,            &u->socket.directory_mode,                       "Socket"  },
+                { "SocketMode",             config_parse_mode,            &u->socket.socket_mode,                          "Socket"  },
                 EXEC_CONTEXT_CONFIG_ITEMS(u->socket.exec_context, "Socket"),
 
                 EXEC_CONTEXT_CONFIG_ITEMS(u->automount.exec_context, "Automount"),