chiark / gitweb /
systemctl: add condreload alias for compat with ALTLinux
[elogind.git] / src / socket.c
index e386c7f2971c7cbe9cd0c4749bc9ee80a05c506b..96c649b0ab04bf6171db46cda9c7f08b4121feca 100644 (file)
@@ -77,6 +77,8 @@ static void socket_init(Unit *u) {
         s->mark = -1;
 
         exec_context_init(&s->exec_context);
+        s->exec_context.std_output = u->meta.manager->default_std_output;
+        s->exec_context.std_error = u->meta.manager->default_std_error;
 
         s->control_command_id = _SOCKET_EXEC_COMMAND_INVALID;
 }
@@ -169,6 +171,13 @@ static int socket_instantiate_service(Socket *s) {
         if (r < 0)
                 return r;
 
+#ifdef HAVE_SYSV_COMPAT
+        if (SERVICE(u)->sysv_path) {
+                log_error("Using SysV services for socket activation is not supported. Refusing.");
+                return -ENOENT;
+        }
+#endif
+
         u->meta.no_gc = true;
         s->service = SERVICE(u);
         return 0;
@@ -1354,12 +1363,19 @@ static int socket_start(Unit *u) {
                 if (s->service->meta.load_state != UNIT_LOADED)
                         return -ENOENT;
 
-                /* If the service is alredy actvie we cannot start the
+                /* If the service is already active we cannot start the
                  * socket */
                 if (s->service->state != SERVICE_DEAD &&
                     s->service->state != SERVICE_FAILED &&
                     s->service->state != SERVICE_AUTO_RESTART)
                         return -EBUSY;
+
+#ifdef HAVE_SYSV_COMPAT
+                if (s->service->sysv_path) {
+                        log_error("Using SysV services for socket activation is not supported. Refusing.");
+                        return -ENOENT;
+                }
+#endif
         }
 
         assert(s->state == SOCKET_DEAD || s->state == SOCKET_FAILED);
@@ -1782,7 +1798,7 @@ void socket_connection_unref(Socket *s) {
 
         /* The service is dead. Yay!
          *
-         * This is strictly for one-onstance-per-connection
+         * This is strictly for one-instance-per-connection
          * services. */
 
         assert(s->n_connections > 0);