pgbouncer problema de inicialização

1

Eu segui os passos do link para a configuração do pgbouncer.

Quando eu inicio o pgbouncer, recebo o erro

Cannot open logfile: 'pgbouncer.log': Permission denied

Transcrição de depuração:

rajavelu-1469@rajavelu-1469:/etc/pgbouncer$ pgbouncer -d -v pgbouncer.ini 
2014-12-29 15:39:31.045 18299 DEBUG parse_ini_file: [databases]
2014-12-29 15:39:31.045 18299 DEBUG parse_ini_file: '*' = 'host=localhost port=5432 user=$USER'
2014-12-29 15:39:31.045 18299 DEBUG parse_ini_file: '*' = 'host=localhost port=5432 user=$USER' ok:1
2014-12-29 15:39:31.045 18299 DEBUG parse_ini_file: [pgbouncer]
2014-12-29 15:39:31.046 18299 DEBUG parse_ini_file: 'listen_port' = '5433'
2014-12-29 15:39:31.046 18299 DEBUG parse_ini_file: 'listen_port' = '5433' ok:1
2014-12-29 15:39:31.046 18299 DEBUG parse_ini_file: 'listen_addr' = 'localhost'
2014-12-29 15:39:31.046 18299 DEBUG parse_ini_file: 'listen_addr' = 'localhost' ok:1
2014-12-29 15:39:31.046 18299 DEBUG parse_ini_file: 'auth_type' = 'any'
2014-12-29 15:39:31.046 18299 DEBUG parse_ini_file: 'auth_type' = 'any' ok:1
2014-12-29 15:39:31.046 18299 DEBUG parse_ini_file: 'logfile' = 'pgbouncer.log'
2014-12-29 15:39:31.046 18299 **FATAL Cannot open logfile: 'pgbouncer.log': Permission denied**

Quando eu começo o pgbouncer com o sudo, recebo o erro

@src/main.c:736 in function main(): PgBouncer should not run as root".

Transcrição de depuração:

rajavelu-1469@rajavelu-1469:/etc/pgbouncer$ sudo pgbouncer -d -v pgbouncer.ini 
2014-12-29 15:39:54.861 18302 DEBUG parse_ini_file: [databases]
2014-12-29 15:39:54.861 18302 DEBUG parse_ini_file: '*' = 'host=localhost port=5432 user=$USER'
2014-12-29 15:39:54.861 18302 DEBUG parse_ini_file: '*' = 'host=localhost port=5432 user=$USER' ok:1
2014-12-29 15:39:54.861 18302 DEBUG parse_ini_file: [pgbouncer]
2014-12-29 15:39:54.862 18302 DEBUG parse_ini_file: 'listen_port' = '5433'
2014-12-29 15:39:54.862 18302 DEBUG parse_ini_file: 'listen_port' = '5433' ok:1
2014-12-29 15:39:54.862 18302 DEBUG parse_ini_file: 'listen_addr' = 'localhost'
2014-12-29 15:39:54.862 18302 DEBUG parse_ini_file: 'listen_addr' = 'localhost' ok:1
2014-12-29 15:39:54.862 18302 DEBUG parse_ini_file: 'auth_type' = 'any'
2014-12-29 15:39:54.862 18302 DEBUG parse_ini_file: 'auth_type' = 'any' ok:1
2014-12-29 15:39:54.862 18302 DEBUG parse_ini_file: 'logfile' = 'pgbouncer.log'
2014-12-29 15:39:54.862 18302 DEBUG parse_ini_file: 'logfile' = 'pgbouncer.log' ok:1
2014-12-29 15:39:54.862 18302 DEBUG parse_ini_file: 'pidfile' = 'pgbouncer.pid'
2014-12-29 15:39:54.862 18302 DEBUG parse_ini_file: 'pidfile' = 'pgbouncer.pid' ok:1
2014-12-29 15:39:54.862 18302 **FATAL @src/main.c:736 in function main(): PgBouncer should not run as root**

Meu arquivo pgbouncer.ini é:

[databases]
* = host=localhost port=5432 user=$USER
[pgbouncer]
listen_port = 5433
listen_addr = localhost
auth_type = any
logfile = pgbouncer.log
pidfile = pgbouncer.pid
    
por Raja 29.12.2014 / 11:13

2 respostas

0

Eu sei que isso é antigo, mas acabei de encontrar esse erro hoje em minha caixa do FreeBSD. A instalação padrão é OK, mas eu precisava executar uma instância pgbouncer diferente.

Para consertar isso eu tive que mudar o rc.d / pgbouncer para adicionar -u para executar.

. /etc/rc.subr

name="pgbouncer_slave"
rcvar=pgbouncer_enable

load_rc_config "$name"
: ${pgbouncer_enable="NO"}
: ${pgbouncer_user="pgbouncer"}
: ${pgbouncer_conf="/usr/local/etc/$name.ini"}

extra_commands="reload"

command="/usr/local/bin/pgbouncer"
pidfile="/var/run/pgbouncer/$name.pid"
required_files="${pgbouncer_conf}"
command_args="-d ${pgbouncer_conf} -u pgbouncer"

run_rc_command "$1"
    
por 29.09.2015 / 11:24
-1

Verifique se o arquivo de log é de propriedade do usuário postgres .

    
por 04.08.2015 / 08:59

Tags