forked from marfrit/marfrit-packages
distcc-avahi: 3.4-18 — fix DISTCC_ARGS/DISTCC_OPTS drift on upgrade (closes #5)
Stock distcc and earlier distcc-avahi releases ship /etc/conf.d/distccd with DISTCC_ARGS=, while our distccd.service reads $DISTCC_OPTS. On hosts that had stock distcc installed first, pacman keeps the existing conf file (it's marked backup=) so the rename never happens — distccd starts with empty options, falls back to --allow-private, and warns about missing /usr/lib/distcc masquerade dir. Add a post_install/post_upgrade .install hook that: - detects DISTCC_ARGS= in /etc/conf.d/distccd and renames to DISTCC_OPTS= (keeping a timestamped backup beside it) - runs update-distcc-symlinks if /usr/lib/distcc is unpopulated - prompts the operator to restart distccd if it's already active Bumps pkgrel to 18. Hit on ampere 2026-04-29 during fourier-campaign distcc enrollment; likely lurking on every host with stock-distcc legacy state.
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
_fix_conf() {
|
||||
local conf=/etc/conf.d/distccd
|
||||
if [ -f "$conf" ] && grep -q '^DISTCC_ARGS=' "$conf"; then
|
||||
cp -a "$conf" "${conf}.pre-distcc-avahi-fix.$(date +%Y%m%d-%H%M%S)"
|
||||
sed -i 's/^DISTCC_ARGS=/DISTCC_OPTS=/' "$conf"
|
||||
echo "==> distcc-avahi: renamed DISTCC_ARGS -> DISTCC_OPTS in $conf"
|
||||
echo " (the systemd unit reads \$DISTCC_OPTS; backup left as ${conf}.pre-distcc-avahi-fix.*)"
|
||||
fi
|
||||
}
|
||||
|
||||
_warn_masq() {
|
||||
if [ ! -d /usr/lib/distcc ]; then
|
||||
echo "==> distcc-avahi: /usr/lib/distcc/ not populated; running update-distcc-symlinks"
|
||||
/usr/bin/update-distcc-symlinks 2>/dev/null || true
|
||||
fi
|
||||
}
|
||||
|
||||
post_install() {
|
||||
_fix_conf
|
||||
_warn_masq
|
||||
}
|
||||
|
||||
post_upgrade() {
|
||||
_fix_conf
|
||||
_warn_masq
|
||||
if systemctl is-active --quiet distccd 2>/dev/null; then
|
||||
echo "==> distcc-avahi: distccd.service is active; restart with"
|
||||
echo " 'sudo systemctl restart distccd' to pick up any conf change"
|
||||
fi
|
||||
}
|
||||
Reference in New Issue
Block a user