Hi all.
Original ticket:
https://github.com/EnterpriseDB/barman/issues/1211
I tried to use barman to backup on mounted NFS in "local" way. Here is some conflict with ownership, because barman by
defaultwork under user barman, but backup files must have owner postgres. So I changed user for barman to postgres and
sodo for barman directories. There is mechanics in Debian how to do this permanently. Need to use dpkg-statoverride:
dpkg-statoverride --add postgres postgres 750 /var/lib/barman
dpkg-statoverride --add postgres postgres 750 /var/log/barman
But this is dont work, the directory still change ower to user barman after package upgrading, because in the
installationscript there is the code that overwrite dpkg-statoverride, in "postinst" script is:
# Make sure the home and log directories exist
for dir in /var/lib/barman /var/log/barman
do
mkdir -p $dir
chown barman:barman $dir
chmod 750 $dir
done
Instead of this "make sure" code the directory must be correctly created in the debian package.
In the file barman.dirs exists only:
/var/lib/barman
But /var/log/barman must be here too.
As for permissions and ownership, the debian policy said
https://www.debian.org/doc/debian-policy/policy.txt
10.10.1. The use of "dpkg-statoverride"
If a system administrator wishes to have a file (or directory or other
such thing) installed with owner and permissions different from those
in the distributed Debian package, they can use the "dpkg-
statoverride" program to instruct "dpkg" to use the different settings
every time the file is installed.
But you use debhelper and I don't see easy method to change ownership of the directory created by dh_installdirs.
But some solutions can be googled.