supervisor开启postgresql
想通过supervisor开机启动postgresql
supervisor配置文件
[program:postgresql_server]
command=/bin/bash -c "exec /usr/local/postgresql_9.6.2/bin/pg_ctl start -l /usr/local/postgresql_9.6.2/data/log/pg_server.log
directory=/usr/local/postgresql_9.6.2/bin"
autostart=true
autorestart=true
user = postgres
开机后supervisorctl status
postgresql_server FATAL can't parse command '/bin/bash -c "exec /usr/local/postgresql_9.6.2/bin/pg_ctl start -l /usr/local/postgresql_9.6.2/data/log/pg_server.log': No closing quotation
日志文件
2017-04-25 22:35:55,093 INFO supervisord started with pid 3641
2017-04-25 22:35:56,096 INFO spawnerr: can't parse command '/bin/bash -c "exec /usr/local/postgresql_9.6.2/bin/pg_ctl start -l /usr/local/postgresql_9.6.2/data/log/pg_server.log': No closing quotation
2017-04-25 22:35:57,098 INFO spawnerr: can't parse command '/bin/bash -c "exec /usr/local/postgresql_9.6.2/bin/pg_ctl start -l /usr/local/postgresql_9.6.2/data/log/pg_server.log': No closing quotation
2017-04-25 22:35:59,103 INFO spawnerr: can't parse command '/bin/bash -c "exec /usr/local/postgresql_9.6.2/bin/pg_ctl start -l /usr/local/postgresql_9.6.2/data/log/pg_server.log': No closing quotation
2017-04-25 22:36:02,111 INFO spawnerr: can't parse command '/bin/bash -c "exec /usr/local/postgresql_9.6.2/bin/pg_ctl start -l /usr/local/postgresql_9.6.2/data/log/pg_server.log': No closing quotation
2017-04-25 22:36:02,111 INFO gave up: postgresql_server entered FATAL state, too many start retries too quickly
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
你得看 postgresql 的日志了,supervisord 的日志不会告诉你错在哪儿,只能告诉你没启动成功。
配置文件错误:command=/bin/bash -c "exec /usr/local/postgresql_9.6.2/bin/pg_ctl start -l /usr/local/postgresql_9.6.2/data/log/pg_server.log
directory=/usr/local/postgresql_9.6.2/bin"
改为command=/bin/bash -c "exec /usr/local/postgresql_9.6.2/bin/pg_ctl start -l /usr/local/postgresql_9.6.2/data/log/pg_server.log"
directory=/usr/local/postgresql_9.6.2/bin
依然错:
2017-04-25 22:56:23,512 INFO supervisord started with pid 785
2017-04-25 22:56:24,516 INFO spawned: 'postgresql_server' with pid 865
2017-04-25 22:56:24,706 INFO exited: postgresql_server (exit status 1; not expected)
2017-04-25 22:56:25,710 INFO spawned: 'postgresql_server' with pid 910
2017-04-25 22:56:25,716 INFO exited: postgresql_server (exit status 1; not expected)
2017-04-25 22:56:27,721 INFO spawned: 'postgresql_server' with pid 1002
2017-04-25 22:56:27,728 INFO exited: postgresql_server (exit status 1; not expected)
2017-04-25 22:56:30,735 INFO spawned: 'postgresql_server' with pid 1285
2017-04-25 22:56:30,743 INFO exited: postgresql_server (exit status 1; not expected)
2017-04-25 22:56:31,745 INFO gave up: postgresql_server entered FATAL state, too many start retries too quickly