fix: cacher: use systemd service drop-in directory

This commit is contained in:
Ben Grande 2024-05-29 13:56:46 +02:00
parent df698b499f
commit 9cb7d72044
No known key found for this signature in database
GPG Key ID: 00C64E14F51F9E56
4 changed files with 18 additions and 33 deletions

View File

@ -1,10 +1,10 @@
#!/bin/sh
# vim: ft=sh
# SPDX-FileCopyrightText: 2023 Benjamin Grande M. S. <ben.grande.b@gmail.com>
# SPDX-FileCopyrightText: 2023 - 2024 Benjamin Grande M. S. <ben.grande.b@gmail.com>
#
# SPDX-License-Identifier: AGPL-3.0-or-later
chown -R apt-cacher-ng:apt-cacher-ng /var/log/apt-cacher-ng
chown -R apt-cacher-ng:apt-cacher-ng /var/cache/apt-cacher-ng
systemctl unmask qubes-apt-cacher-ng
systemctl --no-block restart qubes-apt-cacher-ng
systemctl unmask apt-cacher-ng
systemctl --no-block restart apt-cacher-ng

View File

@ -0,0 +1,7 @@
# SPDX-FileCopyrightText: 2023 - 2024 Benjamin Grande M. S. <ben.grande.b@gmail.com>
#
# SPDX-License-Identifier: AGPL-3.0-or-later
[Service]
ExecStart=
ExecStart=/usr/sbin/apt-cacher-ng -c "/etc/qubes-apt-cacher-ng" ForeGround=1

View File

@ -1,24 +0,0 @@
# SPDX-FileCopyrightText: 2023 Benjamin Grande M. S. <ben.grande.b@gmail.com>
#
# SPDX-License-Identifier: AGPL-3.0-or-later
[Unit]
Description=Qubes Apt-Cacher NG software download proxy
After=network.target
# This can be used to ensure that the service starts only after delayed mount of
# the storage location.
# Note: when the CacheDir folder in configuration file(s) like in
# /etc/apt-cacher-ng/acng.conf is changed, change the next line too!
RequiresMountsFor=/var/cache/apt-cacher-ng
[Service]
# the SocketPath option can be removed if the inetd bridge functionality is not>
ExecStart=/usr/sbin/apt-cacher-ng -c "/etc/qubes-apt-cacher-ng" ForeGround=1
User=apt-cacher-ng
Group=apt-cacher-ng
# This can be changed to notify if the support was enabled at build time
Type=notify
Restart=on-failure
[Install]
WantedBy=multi-user.target

View File

@ -34,8 +34,8 @@ include:
- runtime: False
"{{ slsdotpath }}-disable-apt-cacher-ng":
cmd.run:
- name: systemctl disable apt-cacher-ng
service.disabled:
- name: apt-cacher-ng
"{{ slsdotpath }}-create-qubes-cacher-config-dir":
file.directory:
@ -48,11 +48,12 @@ include:
"{{ slsdotpath }}-systemd-service":
file.managed:
- name: /usr/lib/systemd/system/qubes-apt-cacher-ng.service
- source: salt://{{ slsdotpath }}/files/server/systemd/qubes-apt-cacher-ng.service
- name: /usr/lib/systemd/system/apt-cacher-ng.service.d/50_qusal.conf
- source: salt://{{ slsdotpath }}/files/server/systemd/apt-cacher-ng.service.d/50_qusal.conf
- user: root
- group: root
- mode: '0644'
- makedirs: True
"{{ slsdotpath }}-mask-qubes-apt-cacher-ng":
service.masked:
@ -60,8 +61,8 @@ include:
- runtime: False
"{{ slsdotpath }}-disable-qubes-apt-cacher-ng":
cmd.run:
- name: systemctl disable qubes-apt-cacher-ng
service.disabled:
- name: qubes-apt-cacher-ng
"{{ slsdotpath }}-install-backends_debian":
file.prepend:
@ -99,6 +100,7 @@ include:
file.managed:
- name: /etc/qubes-apt-cacher-ng/acng.conf
- source: salt://{{ slsdotpath }}/files/server/conf/acng.conf
- mode: '0644'
- user: root
- group: root
- makedirs: True