aboutsummaryrefslogtreecommitdiffstats
path: root/systemd/pacserve.service.in
diff options
context:
space:
mode:
Diffstat (limited to 'systemd/pacserve.service.in')
-rw-r--r--systemd/pacserve.service.in28
1 files changed, 28 insertions, 0 deletions
diff --git a/systemd/pacserve.service.in b/systemd/pacserve.service.in
new file mode 100644
index 0000000..7d25640
--- /dev/null
+++ b/systemd/pacserve.service.in
@@ -0,0 +1,28 @@
+# (C) 2013-2025 by Christian Hesse <mail@eworm.de>
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+
+[Unit]
+Description=Serve pacman database files and package archives
+Documentation=https://pacredir.eworm.de/
+Requires=systemd-resolved.service
+After=systemd-tmpfiles-setup.service network.target systemd-resolved.service
+
+[Service]
+EnvironmentFile=/etc/pacserve.conf
+ExecStart=/usr/bin/pacserve /run/pacserve/ --ipv6 --port ${PORT} --no-listing --index empty
+# magic numbers at the end represent TXT data: id=%ID% arch=%ARCH%
+ExecStartPost=+/usr/bin/busctl --quiet call org.freedesktop.resolve1 /org/freedesktop/resolve1 org.freedesktop.resolve1.Manager RegisterService sssqqqaa{say} pacserve 'pacserve on %l' _pacserve._tcp ${PORT} 0 0 1 2 id %ID_BYTES% arch %ARCH_BYTES%
+ExecStopPost=+/usr/bin/busctl --quiet call org.freedesktop.resolve1 /org/freedesktop/resolve1 org.freedesktop.resolve1.Manager UnregisterService o /org/freedesktop/resolve1/dnssd/pacserve
+BindReadOnlyPaths=/var/cache/pacman/pkg:/run/pacserve/pkg /var/lib/pacman/sync:/run/pacserve/db
+DynamicUser=on
+ProtectSystem=full
+ProtectHome=on
+PrivateDevices=on
+NoNewPrivileges=on
+
+[Install]
+WantedBy=multi-user.target