加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

在OpenBSD上配置PostgreSQL

发布时间:2020-12-13 17:18:35 所属栏目:百科 来源:网络整理
导读:当PostgreSQL安装完成后,我们进行以下操作 su-_postgresqlinitdb-D/var/postgresql/data-Upostgres-EUTF8-Amd5-W 之后我们需要配置自动启动 OpenBSD 5.6版本 配置自动启动rc.local if[-x/usr/local/bin/pg_ctl];thenecho-n'postgresql'su-l_postgresql-c"no

当PostgreSQL安装完成后,我们进行以下操作

su-_postgresql
initdb-D/var/postgresql/data-Upostgres-EUTF8-Amd5-W

之后我们需要配置自动启动

OpenBSD 5.6版本

配置自动启动rc.local

if[-x/usr/local/bin/pg_ctl];then
echo-n'postgresql'
su-l_postgresql-c"nohup/usr/local/bin/pg_ctlstart
-D/var/postgresql/data-l/var/postgresql/logfile
-o'-D/var/postgresql/data'>/dev/null"
fi

配置自动停止

if[-f/var/postgresql/data/postmaster.pid];then
su-l_postgresql-c"/usr/local/bin/pg_ctlstop-mfast
-D/var/postgresql/data"
rm-f/var/postgresql/data/postmaster.pid
fi

OpenBSD 5.7版本

在rc.conf.local中添加

pkg_scripts=postgresql

或使用新的rcctl工具

rcctlenablepostgresql

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读