From 6b85d4df44e5fb30d541916b423b192feba474c1 Mon Sep 17 00:00:00 2001 From: Peter Rajnoha Date: Thu, 8 Mar 2012 14:54:05 +0000 Subject: [PATCH] Do not unlink the socket on daemon shutdown if activation is done via systemd. --- libdaemon/server/daemon-server.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libdaemon/server/daemon-server.c b/libdaemon/server/daemon-server.c index c93cde9f1..3cdec3483 100644 --- a/libdaemon/server/daemon-server.c +++ b/libdaemon/server/daemon-server.c @@ -508,7 +508,8 @@ void daemon_start(daemon_state s) syslog(LOG_ERR, "Failed to handle a client connection."); } - if (s.socket_fd >= 0) + /* If activated by systemd, do not unlink the socket - systemd takes care of that! */ + if (!_systemd_activation && s.socket_fd >= 0) if (unlink(s.socket_path)) perror("unlink error");