根据 “在 Linux 环境部署” 教程,部署到测试,在halo用户中可以运行,但是当root用户中,设置为服务时,修改好文件,则出现以下 问题:
-- Logs begin at 六 2022-06-04 11:13:11 CST, end at 一 2022-06-20 16:27:01 CST. --
6月 20 16:20:27 VM-24-14-centos systemd[1]: Unit halo.service entered failed state.
6月 20 16:20:27 VM-24-14-centos systemd[1]: halo.service failed.
6月 20 16:20:27 VM-24-14-centos systemd[1]: halo.service holdoff time over, scheduling restart.
6月 20 16:20:27 VM-24-14-centos systemd[1]: Stopped Halo Service.
6月 20 16:20:27 VM-24-14-centos systemd[1]: Started Halo Service.
6月 20 16:20:27 VM-24-14-centos systemd[1]: halo.service: main process exited, code=exited, status=1/FAILURE
6月 20 16:20:27 VM-24-14-centos systemd[1]: Unit halo.service entered failed state.
6月 20 16:20:27 VM-24-14-centos systemd[1]: halo.service failed.
6月 20 16:20:27 VM-24-14-centos systemd[1]: halo.service holdoff time over, scheduling restart.
配置文件设置
`[Unit]
Description=Halo Service
Documentation=https://docs.halo.run
After=network-online.target
Wants=network-online.target
[Service]
Type=simple
User=halo
[Unit]
Description=Halo Service
Documentation=https://docs.halo.run
After=network-online.target
Wants=network-online.target
[Service]
Type=simple
User=halo
ExecStart=/usr/bin/java -server -Xms256m -Xmx256m -jar YOUR_JAR_PATH
ExecStop=/bin/kill -s QUIT $MAINPID
Restart=always
StandOutput=syslog
StandError=inherit
[Install]
WantedBy=multi-user.target
`