Updated preinst, postinst, and prerm script from Debian's 2.1.10+dfsg-2
This commit applies changes to preinst, postinst, and prerm script on
Debian's 2.1.10+dfsg-2, by Josip Rodin <joy-packages@debian.org>.
Relevant changelog from Debian's 2.1.10+dfsg-2 changelog:
...
We now have to send SIGHUP to the daemon as a postrotate
action, which makes it reopen log files and continue normally.
...
* However, the latter signal also makes the server re-read configuration
files, but unlike the initial server start, this all happens under
the unprivileged user. That in turn means that if by any chance there
is any part of FR configuration that happens not to be readable by
group freerad (or whatever non-default is configured), the reload
will fail, effectively silently, as the log has been moved away. Gah.
So we have to make an effort to ensure that the configuration files
are still readable by that user, otherwise the reload fails and the
aforementioned bug is not fixed. The files seem to revert to
root:root upon conffile actions, at least that's what happened to me
and I think that was the cause. So, on upgrade, try to re-apply the
dpkg-statoverrides on our /etc/freeradius/* stuff, whatever they are,
under the assumption they will let the freerad group read config files
as is the initial setup. (I wish dpkg-statoverride --update $file
just did the right thing, but it doesn't, so there's a new local
function that does that.)
* While doing the latter, noticed that we were checking for directories
in dpkg-statoverride --list output with trailing slashes, but they
get output without it, so it was a no-op. Fixed the check by removing
the trailing slashes. Also then noticed that we were grepping --list
output, but it takes an optional glob pattern, so saved us that
pointless grep fork by using that facility, just as described in the
policy manual.