我几个月前使用了标准安装。我确实使用 nginx 反向代理,请注意它自八月以来一直运行正常。
我没有运行 discourse-setup(嗯,有一次运行了 5 秒后它开始运行设置脚本,但我将其终止并从快照恢复了。我确实运行了 ./launcher rebuild app。
是的:“它会在登录时立即自动运行?”我一登录并 sudo su 切换到 root,它就会自动运行。
我没有使用 Digital Ocean。
我刚查看了 root 的 .bashrc 文件,最后一行是:
/opt/hostinger/scripts/discourse_conf.sh
我来看看它有什么作用。如果它一直都在那里,请注意我并没有添加它。
#!/bin/bash
clear
cd /var/discourse
if ./discourse-setup; then
clear
echo "Discourse is now installed. Log into your admin account in a browser to continue"
echo "configuring Discourse."
cp -f /etc/skel/.bashrc /root/.bashrc
else
echo ""
echo "-----------------------------------------------------------------------------"
echo "The setup script failed with the provided Discourse details."
echo "It will rerun. Please address the above issues."
echo "-----------------------------------------------------------------------------"
echo "When you are ready, press Enter"
echo "To cancel setup, press Ctrl+C and this script will be rerun on your next login"
read wait
fi
Hostinger 托管了虚拟机。我来删除那一行,然后尝试登录和 su,我不知道那是什么时候进入 .bashrc 文件的,我肯定没有手动添加它。
是的,这解决了问题,我从未想过 rc 文件会被这样修改,所以我从未想过检查。非常感谢你们的帮助!
在注释掉 bashrc 中的那一行后:
cd /var/discourse
if ./discourse-setup; then echo 'found it'; else echo 'not found'; fi
返回: not found
对我来说,它能找到它很奇怪,一直都是。
但是,如果我现在运行(大约 15 分钟后) ls -al ./discourse-setup 返回:-rwxr-xr-x 1 root root 28715 Dec 23 23:24 ./discourse-setup
如果我现在运行 if ./discourse-setup; then echo 'found it'; else echo 'not found'; fi,就会出现我遇到的问题:“…将在 5 秒后停止现有容器或按 Control-C 取消”。
我删除了注释,再次登录并运行 sudo su,它想要开始安装过程,但它没有创建 discourse-setup 脚本,那么 discourse-setup 是如何创建的?
discourse-setup 脚本是如何创建的,我可以手动删除它吗? 如果我重命名它,我不会在登录时看到它被重新创建,无论是否有 /opt/hostinger/scripts/discourse_conf.sh 行在 root .bashrc 中。
请注意,我从未见过:
echo "The setup script failed with the provided Discourse details."
echo "It will rerun. Please address the above issues."
它清除了屏幕,我只看到以下注释:
The configuration file containers/app.yml already exists!
Saving old file as app.yml.2024-12-25-193919.bak
Stopping existing container in 5 seconds or Control-C to cancel.
diff ./.bashrc /etc/skel/.bashrc
118d117
< # /opt/hostinger/scripts/discourse_conf.sh
我不知道那一行是怎么进入 .bashrc 文件的,而且我看到的关于问题的文本与 /opt/hostinger/scripts/discourse_conf.sh 文件中描述的不符,但问题似乎已经消失了。
我还注意到,当我运行 ./launcher rebuild app 或重启虚拟机时,如果我尝试过早访问网站,我会收到 502 错误,需要大约一分钟网站才能访问。我过去不记得这样,但也许我从未尝试过立即访问网站。对此有什么看法?