patroni
patroni copied to clipboard
During package installation creates unnecessary directories during installation
Describe the bug During package installation creates unnecessary directories on root file system. %{_sysconfigdir} and %{_logdir}
To Reproduce Just install package version 2.1.2-1.rhel7 or 2.1.3-1.rhel7 from PostgreSQL Common repository.
Into rpm package this postinstall script.
postinstall scriptlet (using /bin/sh):
/usr/bin/mkdir -p %{_logdir}/patroni
/usr/bin/mkdir -p %{_sysconfigdir}/patroni/callbacks
touch %{_sysconfigdir}/patroni/callbacks/callbacks.sh
if [ $1 -eq 1 ] ; then
/bin/systemctl daemon-reload >/dev/null 2>&1 || :
if [ $1 -eq 1 ] ; then
# Initial installation
systemctl preset patroni.service >/dev/null 2>&1 || :
fi
In version 2.1.1-1.rhel7
postinstall scriptlet (using /bin/sh):
if [ $1 -eq 1 ] ; then
/bin/systemctl daemon-reload >/dev/null 2>&1 || :
if [ $1 -eq 1 ] ; then
# Initial installation
systemctl preset patroni.service >/dev/null 2>&1 || :
fi
I hope you realize that we don't maintain rpm/deb packages.
cc @devrimgunduz
@Aytuar what is unnecessary? Log directory and callbacks directory?
@devrimgunduz The %{_sysconfigdir} and %{_logdir} parameters are not passed to the script when creating an rpm package. Therefore, when installing an rpm package, they are perceived as the names of directories that are created in the root of the file system.
Simply the names of the directories %{_logdir} and %{_sysconfigdir} are created, just as I write them now. /%{_logdir}/patroni /%{_sysconfigdir}/patroni/callbacks
%{_logdir} should be /var/log, and %{_sysconfigdir} should be /etc There is an error in the spec file with which the rpm package is built and the variables are not replaced by their values.
Hello! I install Patroni on CentOS 8 and 9 Source : patroni-2.1.7-1.rhel8.src.rpm Repository : @System From repo : PostgreSQL-Common
I have this folder also in root directory.
How to fix this bug?
Hi,
Please install 3.0.0-2 RPMs, which I just released.
Regards, Devrim
It's help me/ Thanks!