首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >PostgreSQL问题:系统未以系统作为init系统(PID 1)引导。

PostgreSQL问题:系统未以系统作为init系统(PID 1)引导。
EN

Stack Overflow用户
提问于 2021-12-13 09:59:46
回答 1查看 1.1K关注 0票数 0
代码语言:javascript
复制
psql: error: connection to server on socket "/var/run/postgresql/.s.PGSQL.5432" failed: No such file or directory
        Is the server running locally and accepting connections on that socket?

我试着跟踪PostgreSQL: Why psql can't connect to server?,但是在键入之后

代码语言:javascript
复制
sudo service postgresql start

我得到:

代码语言:javascript
复制
 * Starting PostgreSQL 14 database server                                                                                * Error: /usr/lib/postgresql/14/bin/pg_ctl /usr/lib/postgresql/14/bin/pg_ctl start -D /var/lib/postgresql/14/main -l /var/log/postgresql/postgresql-14-main.log -s -o  -c config_file="/etc/postgresql/14/main/postgresql.conf"  exited with status 1:
2021-12-13 10:54:29.791 CET [180] LOG:  starting PostgreSQL 14.1 (Ubuntu 14.1-2.pgdg20.04+1) on x86_64-pc-linux-gnu, compiled by gcc (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0, 64-bit
2021-12-13 10:54:29.797 CET [180] LOG:  could not bind IPv4 address "127.0.0.1": Permission denied
2021-12-13 10:54:29.798 CET [180] WARNING:  could not create listen socket for "localhost"
2021-12-13 10:54:29.798 CET [180] FATAL:  could not create any TCP/IP sockets
2021-12-13 10:54:30.039 CET [180] LOG:  database system is shut down
pg_ctl: could not start server
Examine the log output.

之后: sudo /tmp/ -name .s.PGSQL.5432 -> nothing After: systemctl状态postgresql -> system尚未以systemd作为init系统(PID 1)进行引导。不能动手术。未能连接到总线:主机已关闭

怎么修呢?我正在尝试安装chirpstack服务器

EN

回答 1

Stack Overflow用户

发布于 2022-03-31 07:47:08

我也有同样的问题。看起来你像我一样在wsl3中使用Ubuntu。

代码语言:javascript
复制
ps -p 1 -o comm=

如果在上面的命令之后得到init,那么就意味着您的ubuntu使用的是SysV而不是systemd。您可以使用以下命令。

代码语言:javascript
复制
sudo service postgresql status
sudo service postgresql start
sudo service postgresql stop
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/70332810

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档