今天安装rvm的时候碰到一个问题:

(wifiphisher_env) fcbai@fcbai-a4:~/software/security$ curl -sSL https://get.rvm.io | bash -s stable
curl: (7) Failed to connect to raw.githubusercontent.com port 443 after 18 ms: Connection refused

研究了下发现是域名污染的问题,在hosts里面添加一行:

185.199.108.133 raw.githubusercontent.com

即可解决,后来启动PG后,通过status去看,会发现状态是exited:

fcbai@fcbai-a4:/opt$ sudo service postgresql status
● postgresql.service - PostgreSQL RDBMS
Loaded: loaded (/lib/systemd/system/postgresql.service; enabled; vendor preset: enabled)
Active: active (exited) since Fri 2022-11-11 18:49:37 CST; 5min ago
Process: 3240322 ExecStart=/bin/true (code=exited, status=0/SUCCESS)
Main PID: 3240322 (code=exited, status=0/SUCCESS)
CPU: 644us

11月 11 18:49:37 fcbai-a4 systemd[1]: Starting PostgreSQL RDBMS...
11月 11 18:49:37 fcbai-a4 systemd[1]: Finished PostgreSQL RDBMS.

但是/var/log/postgresql/postgresql-14-main.log下并没有异常,且pg可以正常使用,后来发现对于pg的status需要加上对应的版本,也就是这样去看:

fcbai@fcbai-a4:/opt$ systemctl status postgresql@14-main
● postgresql@14-main.service - PostgreSQL Cluster 14-main
Loaded: loaded (/lib/systemd/system/postgresql@.service; enabled-runtime; vendor preset: enabled)
Active: active (running) since Fri 2022-11-11 18:49:37 CST; 5min ago
Process: 3240287 ExecStart=/usr/bin/pg_ctlcluster --skip-systemctl-redirect 14-main start (code=exited, status=0/SUCCESS)
Main PID: 3240292 (postgres)
Tasks: 7 (limit: 76774)
Memory: 29.3M
CPU: 159ms
CGroup: /system.slice/system-postgresql.slice/postgresql@14-main.service
├─3240292 /usr/lib/postgresql/14/bin/postgres -D /var/lib/postgresql/14/main -c config_file=/etc/postgresql/14/main/postgresql.conf
├─3240294 "postgres: 14/main: checkpointer " "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" >
├─3240295 "postgres: 14/main: background writer " "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" ">
├─3240296 "postgres: 14/main: walwriter " "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" >
├─3240297 "postgres: 14/main: autovacuum launcher " "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "">
├─3240298 "postgres: 14/main: stats collector " "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" >
└─3240299 "postgres: 14/main: logical replication launcher " "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "">

11月 11 18:49:35 fcbai-a4 systemd[1]: Starting PostgreSQL Cluster 14-main...
11月 11 18:49:37 fcbai-a4 systemd[1]: Started PostgreSQL Cluster 14-main.

这样则能正常看到状态。


扫码手机观看或分享: