大网数据广告活动
服务器运维问答

PostgreSQL systemd service is /bin/true

· 52CE 我爱测

postgresql.service contents is # systemd service for managing all PostgreSQL clusters on the system. This # service is actually a systemd target, but we are using a service since # targets cannot be reloaded. [Unit] Description=P…

问题原文

原帖链接 · Евгений Новиков · CC BY-SA 4.0

postgresql.service contents is

# systemd service for managing all PostgreSQL clusters on the system. This
# service is actually a systemd target, but we are using a service since
# targets cannot be reloaded.

[Unit]
Description=PostgreSQL RDBMS
[Service]
Type=oneshot
ExecStart=/bin/true
ExecReload=/bin/true
RemainAfterExit=on

[Install]
WantedBy=multi-user.target

I tried to start PostrgeSQL by service postgresql start and was surprised by postgresql.service contents, because it starts /bin/true

uname -a output:

Linux debian 3.16.0-4-amd64 #1 SMP Debian 3.16.7-ckt25-2+deb8u3 (2016-07-02) x86_64 GNU/Linux

So my questions is: Why it happens, and how to fix it?

社区高分解答

原帖链接 · danblack · CC BY-SA 4.0

As indicated on the thread by @termcap, postgresql@{version}-main.service is the new service name.

So use systemctl {start|enable} [email omitted].

Sensibly the postgresql.service should contain a friendly migration warning rather than /bin/true (work it out yourself).

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2018-01-29)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。