# systemctl status postgresql.service
● postgresql.service - PostgreSQL database server
Loaded: loaded (/etc/systemd/system/postgresql.service; enabled; vendor preset: disabled)
Active: activating (start) since Thu 2021-02-04 12:38:17 CET; 15min ago
Docs: man:postgres(1)
Main PID: 6688 (postgres)
CGroup: /system.slice/postgresql.service
├─6688 /opt/data/pgsql/10.15/bin/postgres -D /opt/data/postgres/data/10/data
├─6689 postgres: logger process
├─6696 postgres: checkpointer process
cat /etc/systemd/system/postgresql.service
[Unit]
Description=PostgreSQL database server
Documentation=man:postgres(1)
[Service]
Type=notify
User=postgres
ExecStart=/opt/data/pgsql/10.15/bin/postgres -D /opt/data/postgres/data/10/data
ExecReload=/bin/kill -HUP $MAINPID
KillMode=mixed
KillSignal=SIGINT
TimeoutSec=0
[Install]
WantedBy=multi-user.target
所以请任何人都可以帮助我获得所需的输出作为活动:活动(运行))
我尝试评论
Type=Notify
行,效果很好。
仅适用于 PostgreSQL 9x。
10 及以上版本没问题。