Why can't start pgbouncer process when setting logfile to /var/log/ path?
-
25-02-2021 - |
문제
This pgbouncer.ini setting can't start pgbouncer:
[databases]
mydb = host=127.0.0.1 port=5432 dbname=mydb
[pgbouncer]
listen_port = 6432
listen_addr = 127.0.0.1
auth_type = md5
auth_file = userlist.txt
logfile = /var/log/pgbouncer/pgbouncer.log
pidfile = /var/run/pgbouncer/pgbouncer.pid
admin_users = someuser
No pid file generated, no log file created. No process running(ps aux | grep pgbouncer
).
But if set logfile
and pidfile
to:
logfile = pgbouncer.log
pidfile = pgbouncer.pid
pgbouncer can be started by run pgbouncer -d pgbouncer.ini
. It will create log file and pid file at the same path of pgbouncer.ini
.
I am using normal user doing it.
해결책
Either you don't have permission to write to /var/log/pgbouncer
as the user you are running as, or the directory doesn't exist and pgbouncer doesn't or can't create it.
A third possibility is that the permissions on that directory are TOO relaxed, but I don't think pgbouncer checks that.
제휴하지 않습니다 dba.stackexchange