查看状态提示如下:
root@tanrs:~# systemctl status cloudreve
● cloudreve.service - Cloudreve
Loaded: loaded (/usr/lib/systemd/system/cloudreve.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Mon 2024-10-28 17:00:12 CST; 15min ago
Docs: https://docs.cloudreve.org
Process: 1793 ExecStart=/mnt/disk/cloudreve/cloudreve (code=exited, status=4)
Main PID: 1793 (code=exited, status=4)
CPU: 48.241s
Oct 28 17:00:12 tanrs cloudreve[1793]: [signal SIGBUS: bus error code=0x2 addr=0xd75200 pc=0xd75200]
Oct 28 17:00:12 tanrs cloudreve[1793]: fatal error: unexpected signal during runtime execution
Oct 28 17:00:12 tanrs cloudreve[1793]: panic during panic
Oct 28 17:00:12 tanrs cloudreve[1793]: [signal SIGBUS: bus error code=0x2 addr=0x75c08 pc=0x75c08]
Oct 28 17:00:12 tanrs cloudreve[1793]: runtime stack:
Oct 28 17:00:12 tanrs cloudreve[1793]: fatal error: unexpected signal during runtime execution
Oct 28 17:00:12 tanrs cloudreve[1793]: stack trace unavailable
Oct 28 17:00:12 tanrs systemd[1]: cloudreve.service: Main process exited, code=exited, status=4/NOPERMISSION
Oct 28 17:00:12 tanrs systemd[1]: cloudreve.service: Unit entered failed state.
Oct 28 17:00:12 tanrs systemd[1]: cloudreve.service: Failed with result 'exit-code'.
cloudreve.service文件配置如下:
[Unit]
Description=Cloudreve
Documentation=https://docs.cloudreve.org
After=network.target
After=mysqld.service
Wants=network.target
[Service]
WorkingDirectory=/mnt/disk/cloudreve
ExecStart=/mnt/disk/cloudreve/cloudreve
Restart=on-abnormal
RestartSec=5s
KillMode=mixed
StandardOutput=null
StandardError=syslog
[Install]
WantedBy=multi-user.target
更新配置,开机自启都设置了。
更新配置
systemctl daemon-reload
启动服务
systemctl start cloudreve
设置开机启动
systemctl enable cloudreve