sans_souciの日記

無憂茶房

postgresql 9.6 from source on centos 7.x

ソースからPostgresql 9.6 を CentOS 7.x にインストールした後に実施する操作

サービスとして取り扱えるように次のように設定する。

保存先ディレクトリ: * /etc/systemd/system

ファイル名: * postgresql.service

[Unit]
Description=PostgreSQL database server
Documentation=man:postgres(1)
After=network.target

[Service]
#Type=notify
#Type=simple
Type=forking
User=postgres
Group=postgres
ExecStart=/usr/local/pgsql/bin/pg_ctl start -D /usr/local/pgsql/data -s -w
ExecStop=/usr/local/pgsql/bin/pg_ctl stop -D /usr/local/pgsql/data -s -m fast
ExecReload=/usr/local/pgsql/bin/pg_ctl reload -D /usr/local/pgsql/data -s
TimeoutSec=0

[Install]
WantedBy=multi-user.target

上記のファイルをディレクトリに配備した後に、次の操作を実施する。

# systemctl daemon-reload

・・・課題 ログファイルの配備場所と、PIDに関する設定が必要だったような?