diff options
Diffstat (limited to 'systemd')
-rw-r--r-- | systemd/pacredir.service | 10 | ||||
-rw-r--r-- | systemd/pacserve.service | 22 | ||||
-rw-r--r-- | systemd/pacserve.service.in | 28 | ||||
-rw-r--r-- | systemd/sysusers.conf | 2 |
4 files changed, 34 insertions, 28 deletions
diff --git a/systemd/pacredir.service b/systemd/pacredir.service index ed5e45a..ad267a2 100644 --- a/systemd/pacredir.service +++ b/systemd/pacredir.service @@ -1,4 +1,4 @@ -# (C) 2013-2024 by Christian Hesse <mail@eworm.de> +# (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 @@ -6,10 +6,10 @@ # (at your option) any later version. [Unit] -Description=Redirect pacman requests via avahi service -Requires=avahi-daemon.service -After=avahi-daemon.service network.target network-online.target -Documentation=https://github.com/eworm-de/pacredir#pacredir +Description=Redirect pacman requests via mDNS Service Discovery +Documentation=https://pacredir.eworm.de/ +Requires=systemd-resolved.service +After=network.target network-online.target systemd-resolved.service [Service] Type=notify diff --git a/systemd/pacserve.service b/systemd/pacserve.service deleted file mode 100644 index d5e064d..0000000 --- a/systemd/pacserve.service +++ /dev/null @@ -1,22 +0,0 @@ -# (C) 2013-2024 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 -After=systemd-tmpfiles-setup.service network.target - -[Service] -ExecStart=/usr/bin/pacserve /run/pacserve/ --ipv6 --port 7078 --no-listing --index empty -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 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 diff --git a/systemd/sysusers.conf b/systemd/sysusers.conf index cd2e81c..ced5210 100644 --- a/systemd/sysusers.conf +++ b/systemd/sysusers.conf @@ -1 +1 @@ -u pacredir - "redirect pacman requests" +u! pacredir - "redirect pacman requests" |