chiark / gitweb /
mkdir: append _label to all mkdir() calls that explicitly set the selinux context
[elogind.git] / src / core / socket.c
index 60ea3cb25cfb4b794c1444829395ae9e4b893acf..633663e7e0018f19a176a64aa6765e33b4b54078 100644 (file)
@@ -37,6 +37,7 @@
 #include "load-fragment.h"
 #include "strv.h"
 #include "mkdir.h"
+#include "path-util.h"
 #include "unit-name.h"
 #include "dbus-socket.h"
 #include "missing.h"
@@ -164,7 +165,7 @@ static int socket_instantiate_service(Socket *s) {
                 return r;
 
 #ifdef HAVE_SYSV_COMPAT
-        if (SERVICE(u)->sysv_path) {
+        if (SERVICE(u)->is_sysv) {
                 log_error("Using SysV services for socket activation is not supported. Refusing.");
                 return -ENOENT;
         }
@@ -760,7 +761,7 @@ static int fifo_address_create(
         assert(path);
         assert(_fd);
 
-        mkdir_parents(path, directory_mode);
+        mkdir_parents_label(path, directory_mode);
 
         r = label_context_set(path, S_IFIFO);
         if (r < 0)
@@ -1574,7 +1575,7 @@ static int socket_start(Unit *u) {
                 }
 
 #ifdef HAVE_SYSV_COMPAT
-                if (service->sysv_path) {
+                if (service->is_sysv) {
                         log_error("Using SysV services for socket activation is not supported. Refusing.");
                         return -ENOENT;
                 }
@@ -2219,5 +2220,23 @@ const UnitVTable socket_vtable = {
 
         .bus_interface = "org.freedesktop.systemd1.Socket",
         .bus_message_handler = bus_socket_message_handler,
-        .bus_invalidating_properties =  bus_socket_invalidating_properties
+        .bus_invalidating_properties =  bus_socket_invalidating_properties,
+
+        .status_message_formats = {
+                /*.starting_stopping = {
+                        [0] = "Starting socket %s...",
+                        [1] = "Stopping socket %s...",
+                },*/
+                .finished_start_job = {
+                        [JOB_DONE]       = "Listening on %s.",
+                        [JOB_FAILED]     = "Failed to listen on %s.",
+                        [JOB_DEPENDENCY] = "Dependency failed for %s.",
+                        [JOB_TIMEOUT]    = "Timed out starting %s.",
+                },
+                .finished_stop_job = {
+                        [JOB_DONE]       = "Closed %s.",
+                        [JOB_FAILED]     = "Failed stopping %s.",
+                        [JOB_TIMEOUT]    = "Timed out stopping %s.",
+                },
+        },
 };