$ tar -xvf postgresql-11.2.tar.gz
$ cd postgresql-11.2
$ less INSTALL
--with-systemd
Build with support for systemd service notifications. This
improves integration if the server binary is started under
systemd but has no impact otherwise. libsystemd and the
associated header files need to be installed to be able to
use this option.
と記載されいたので、「--with-systemd」 付きでconfigureしたら
$ ./configure --with-systemd : checking systemd/sd-daemon.h usability... no checking systemd/sd-daemon.h presence... no checking for systemd/sd-daemon.h... no configure: error: header file <systemd/sd-daemon.h> is required for systemd support
と、エラー
$ sudo yum install systemd-devel
のように systemd-devel が必要らしい。
後は、 https://www.postgresql.org/docs/11/server-start.html に記載の通り postgresql.service を作成し、登録すればOK
$ sudo vi /etc/systemd/system/postgresql.service [Unit] Description=PostgreSQL database server Documentation=man:postgres(1) [Service] Type=notify User=postgres ExecStart=/usr/local/pgsql/bin/postgres -D /usr/local/pgsql/data ExecReload=/bin/kill -HUP $MAINPID KillMode=mixed KillSignal=SIGINT TimeoutSec=0 [Install] WantedBy=multi-user.target
その他、make 手順はINSTALLファイルにコマンドラインレベルで記載されています