commit 4f84bb497a08806f8cdd2a9a61e5b4c4c88042a1
parent 772415c034ca5a03fe7424d74a3e6fe4cbd49528
Author: Christian Grothoff <christian@grothoff.org>
Date: Sun, 7 Sep 2025 10:40:09 +0200
add socket activation (fixes #9464)
Diffstat:
2 files changed, 26 insertions(+), 0 deletions(-)
diff --git a/debian/sync-httpd.service b/debian/sync-httpd.service
@@ -1,6 +1,7 @@
[Unit]
Description=Sync backup backend
After=postgresql.service network.target
+Requires=sync-httpd.socket
[Service]
User=sync-httpd
@@ -9,11 +10,22 @@ Restart=always
RestartMode=direct
RestartSec=1s
RestartPreventExitStatus=9
+
+# Disable the service if more than 5 restarts are encountered within 5s.
+# These are usually the systemd defaults, but can be overwritten, thus we set
+# them here explicitly, as the exchange code assumes StartLimitInterval
+# to be >=5s.
+StartLimitBurst=5
+StartLimitInterval=5s
+
RuntimeMaxSec=3600s
ExecStart=/usr/bin/sync-httpd -c /etc/sync/sync.conf -L INFO
StandardOutput=journal
StandardError=journal
+PrivateTmp=yes
+PrivateDevices=yes
+ProtectSystem=full
[Install]
WantedBy=multi-user.target
diff --git a/debian/sync-httpd.socket b/debian/sync-httpd.socket
@@ -0,0 +1,14 @@
+[Unit]
+Description=Sync Socket
+PartOf=sync-httpd.service
+
+[Socket]
+ListenStream=/run/sync/httpd/sync-http.sock
+Accept=no
+Service=sync-httpd.service
+SocketUser=sync-httpd
+SocketGroup=www-data
+SocketMode=0660
+
+[Install]
+WantedBy=sockets.target