blob: 78258ee91a9e93e689768e8abf6463b5daeb2d11 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
pre_install() {
groupadd -r apt-cacher-ng
useradd -d /var/cache/apt-cacher-ng -g apt-cacher-ng -r -s /usr/bin/nologin apt-cacher-ng
}
post_install() {
chown -R apt-cacher-ng:apt-cacher-ng /var/cache/apt-cacher-ng /var/log/apt-cacher-ng
chown apt-cacher-ng:apt-cacher-ng /etc/apt-cacher-ng/security.conf
echo "You may want to customize the backends in /etc/apt-cacher-ng"
}
post_upgrade() {
echo "Warning: If after upgrading apt-cacher-ng fails to start, owner of a few directories might have to be adjusted:"
echo "chown -R apt-cacher-ng:apt-cacher-ng /var/cache/apt-cacher-ng /run/apt-cacher-ng /var/log/apt-cacher-ng"
chown apt-cacher-ng:apt-cacher-ng /etc/apt-cacher-ng/security.conf
systemctl daemon-reload
systemd-tmpfiles --create
}
post_remove() {
userdel apt-cacher-ng
groupdel apt-cacher-ng || return 0
}
|