From 32296857292b4c0cd9427de265485e376b5fbea7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=80=97=E5=AD=90?= Date: Tue, 26 Sep 2023 01:19:05 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=20logind=20=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/postgresql/install.sh | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/scripts/postgresql/install.sh b/scripts/postgresql/install.sh index 27591a4c..695e8120 100644 --- a/scripts/postgresql/install.sh +++ b/scripts/postgresql/install.sh @@ -163,6 +163,13 @@ TimeoutSec=infinity WantedBy=multi-user.target EOF +# 在 /etc/systemd/logind.conf 设置 RemoveIPC=no,不然会删除 /dev/shm 下的共享内存文件 +checkRemoveIPC=$(cat /etc/systemd/logind.conf | grep '^RemoveIPC=no.*$') +if [ "${checkRemoveIPC}" == "" ]; then + echo "RemoveIPC=no" >> /etc/systemd/logind.conf + systemctl restart systemd-logind +fi + # 启动服务 systemctl daemon-reload systemctl enable postgresql @@ -170,7 +177,4 @@ systemctl start postgresql panel writePlugin postgresql${1} ${postgresqlVersion} -# 测试中发现不重启一下,会导致无法连接 -systemctl restart postgresql - echo -e "${HR}\nPostgreSQL-${1} 安装完成\n${HR}"