Systemctl方式
编辑配置文件
vi /usr/lib/systemd/system/cloudreve.service
[Unit]
Description=Cloudreve //服务名称
Documentation=https://docs.cloudreve.org //文档地址
After=network.target //
Wants=network.target //
[Service]
WorkingDirectory=/PATH_TO_CLOUDREVE //运行目录
ExecStart=/PATH_TO_CLOUDREVE/cloudreve //可执行文件
Restart=on-abnormal
RestartSec=5s //失败重启 5s
KillMode=mixed
StandardOutput=null
StandardError=syslog
[Install]
WantedBy=multi-user.target
更新
# 更新配置
systemctl daemon-reload
# 启动服务
systemctl start cloudreve
# 设置开机启动
systemctl enable cloudreve