supervisor开启postgresql

发布于 2021-11-30 04:38:01 字数 1705 浏览 832 评论 2

想通过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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

草莓味的萝莉 2021-12-05 12:07:07

你得看 postgresql 的日志了,supervisord 的日志不会告诉你错在哪儿,只能告诉你没启动成功。

平生欢 2021-12-02 04:53:13

配置文件错误: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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文