微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

阻止PostgreSQL在Ubuntu中启动时启动

我正在使用Postgresql 9.2,它在我启动系统时自动运行(Kubuntu).

我怎么能避免这个?

我需要手动启动它,我不希望它无人值守,因为我需要查看控制台.

Ubuntu或Debian可以运行Postgresql的多个实例,并提供自动启动/停止/启动每个群集的特定方法.

在/etc/postgresql/9.2/main(或更一般地说是/ etc / postgresql /< version> /< clustername>)中应该有一个名为start.conf的文件,其中包含以下不言自明的内容

# Automatic startup configuration
# auto: automatically start/stop the cluster in the init script
# manual: do not start/stop in init scripts,but allow manual startup with
#         pg_ctlcluster
# disabled: do not allow manual startup with pg_ctlcluster (this can be easily
#           circumvented and is only meant to be a small protection for
#           accidents).

auto

如果您通过手动替换auto,则只能在需要时使用以下命令启动此Postgresql实例:

sudo pg_ctlcluster 9.2 main start

至于查看控制台,您需要的是在使用数据库时在终端中运行:

tail -f /var/log/postgresql/postgresql-9.2-main.log

原文地址:https://www.jb51.cc/postgresql/192238.html

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐