agora inbox for pgsql-pkg-debian@postgresql.org
help / color / mirror / Atom feedFrom: Олег Самойлов <od.samoylov@interfax.ru>
To: pgsql-pkg-debian@postgresql.org <pgsql-pkg-debian@postgresql.org>
Cc: Роман Сутемьев <Roman.Sutemiev@interfax.ru>
Subject: Debian package installation script overwrite debian dpkg statoverride.
Date: Sat, 1 Aug 2026 09:28:04 +0000
Message-ID: <cdf808f5b18b4097b816b9bf6049decf@interfax.ru> (raw)
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 default work under user barman, but backup files must have owner postgres. So I changed user for barman to postgres and so do 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 installation script 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.
Message-ID: <cdf808f5b18b4097b816b9bf6049decf@interfax.ru>
Permalink: ../cdf808f5b18b4097b816b9bf6049decf@interfax.ru/
Also on: postgresql.org/message-id/cdf808f5b18b4097b816b9bf6049decf@interfax.ru
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-pkg-debian@postgresql.org
Cc: od.samoylov@interfax.ru, Roman.Sutemiev@interfax.ru
Subject: Re: Debian package installation script overwrite debian dpkg statoverride.
In-Reply-To: <cdf808f5b18b4097b816b9bf6049decf@interfax.ru>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox