trying to start pgbouncer I see in log:
2017-04-25 11:18:06.319 7186 FATAL @src/main.c:612 in function check_pidfile(): pidfile exists, another instance running?
indeed, it was not deleted by service pgbouncer stop
:
[root@b ~]# grep pid /etc/pgbouncer/pgbouncer.ini
pidfile = /pg/pgbouncer/pgbouncer.pid
[root@b ~]# ls -al /pg/pgbouncer/pgbouncer.pid
-rw-r--r-- 1 pgbouncer pgbouncer 5 Apr 25 10:45 /pg/pgbouncer/pgbouncer.pid
because it is hard coded in init:
[root@b ~]# grep ^pid /etc/init.d/pgbouncer
pidfile=/var/run/pgbouncer/pgbouncer.pid
when I change the path to the one I specify in /etc/pgbouncer/pgbouncer.ini
it starts working...
Qestion: What do I do to make init.d
pickup pid file location from config?
I have:
[root@b ~]# uname -a
Linux 4.9.20-11.31.amzn1.x86_64 #1 SMP Thu Apr 13 01:53:57 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
[root@b ~]# pgbouncer -V
pgbouncer version 1.7.2
Installed it with:
wget https://download.postgresql.org/pub/repos/yum/9.6/redhat/rhel-6-x86_64/pgdg-ami201503-96-9.6-2.noarch.rpm
rpm -ivh pgdg-ami201503-96-9.6-2.noarch.rpm
yum install pgbouncer
.