aboutsummaryrefslogtreecommitdiffstats
path: root/systemd/pacserve.service.in
blob: 7d2564042652526b4cd931a871100d1a04f271e1 (about) (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
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