chiark / gitweb /
bus: fix hello ioctl buffer size calculation
[elogind.git] / src / core / socket.c
index aaaa8d6499b94da2f8e864fcaeb936dc8a107ec5..31fc2a25269a659125ee42f284792e8040943af8 100644 (file)
@@ -1254,6 +1254,7 @@ static int socket_spawn(Socket *s, ExecCommand *c, pid_t *_pid) {
                        UNIT(s)->manager->cgroup_supported,
                        UNIT(s)->cgroup_path,
                        UNIT(s)->id,
+                       0,
                        NULL,
                        s->exec_runtime,
                        &pid);
@@ -1475,6 +1476,13 @@ static void socket_enter_running(Socket *s, int cfd) {
                         /* Flush all sockets by closing and reopening them */
                         socket_close_fds(s);
 
+                        r = socket_open_fds(s);
+                        if (r < 0) {
+                                log_warning_unit(UNIT(s)->id, "%s failed to listen on sockets: %s", UNIT(s)->id, strerror(-r));
+                                socket_enter_stop_pre(s, SOCKET_FAILURE_RESOURCES);
+                                return;
+                        }
+
                         r = socket_watch_fds(s);
                         if (r < 0) {
                                 log_warning_unit(UNIT(s)->id, "%s failed to watch sockets: %s", UNIT(s)->id, strerror(-r));
@@ -2417,7 +2425,6 @@ const UnitVTable socket_vtable = {
 
         .bus_interface = "org.freedesktop.systemd1.Socket",
         .bus_vtable = bus_socket_vtable,
-        .bus_changing_properties = bus_socket_changing_properties,
         .bus_set_property = bus_socket_set_property,
         .bus_commit_properties = bus_socket_commit_properties,