cloudreve / Cloudreve

🌩支持多家云存储的云盘系统 (Self-hosted file management and sharing system, supports multiple storage providers)
https://cloudreve.org
GNU General Public License v3.0
21.65k stars 3.4k forks source link

使用systemd进程守护时运行失败,但是前台运行良好 #889

Closed gylove1994 closed 2 years ago

gylove1994 commented 3 years ago

问题描述 我在对cloudreve pro的linux版进行部署时,前台运行良好,但是只要涉及到sysytemd进程守护运行时,就会出现一些令人匪夷所思的BUG。从输出的问题来看很可能是数据库方面的问题,但是无论使用litedb数据库,还是换用mysql数据库,都会存在一些非常致命的问题。最后,希望各位可以协助我解决这一问题,谢谢。 如何复原这一情况 请遵循一下步骤:

  1. 安装CentOS 8.2.2004 x64 版
  2. 使用yum源安装MySQL-server
  3. 创建名为cloudreve的空数据库
  4. 创建名为cloudreve的用户,并给予cloudreve库的全部操作权限
  5. 下载并安装cloudreve pro,赋予该程序777权限,编辑conf.ini,写入相关数据库相关内容
  6. 前台启动测试,一切正常
  7. ctrl + c 关闭cloudreve pro前台进程
  8. 按照手册编辑cloudreve.service
  9. 使用systemctl daremon-reload更新配置
  10. 尝试启动,启动失败

可能的情况 在查看报错提示时,我发现在进程守护下运行时,mysql数据库连接失败,但是在前台运行时却无报错警告。 很有可能是与权限相关的问题,但是由于我对于linux系统以及mysql数据库不太了解,无法解决这一问题。

相关配置及日志 程序所在目录: /etc/cloudreve 配置conf.ini: image 配置cloudreve.service: image systemctl status: image journalctl -u cloudreve: image 前台运行: image

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

JohyC commented 2 years ago

我在这边回答有写示例,你可以参考一下。 https://github.com/cloudreve/Cloudreve/issues/749#issuecomment-1200378568