systemctl status postgresql.service 显示不同的输出

问题描述 投票:0回答:1
  1. 未退出操作系统(Linux)提示符。需要执行 ctrl+c 才能退出提示符
  2. 输出未按预期显示(Active:激活(启动)而不是 Active:活动(运行)) 但 postgresql 服务正在启动。
# 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

所以请任何人都可以帮助我获得所需的输出作为活动:活动(运行))

postgresql database-administration
1个回答
0
投票

我尝试评论

Type=Notify
行,效果很好。 仅适用于 PostgreSQL 9x。 10 及以上版本没问题。

© www.soinside.com 2019 - 2024. All rights reserved.