sage-server.service
[Service]
ExecStart=/usr/local/jdk-21.0.2+13/bin/java -jar /home/freedom/local/sage-app*.jar
当我运行
systemctl status sage-server
时,失败了。
错误:无法访问 jarfile /home/freedom/local/sage-app*.jar
但是我直接运行
/usr/local/jdk-21.0.2+13/bin/java -jar /home/freedom/local/sage-app*.jar
就成功了。
Linux版本:Debian 12
PRETTY_NAME="Debian GNU/Linux 12 (bookworm)"
NAME="Debian GNU/Linux"
VERSION_ID="12"
VERSION="12 (bookworm)"
VERSION_CODENAME=bookworm
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"
ExecStart 不允许您使用 shell 功能...除非您 ExecStart 一个 shell。
ExecStart=/bin/sh -c '/usr/local/jdk-21.0.2+13/bin/java -jar /home/freedom/local/sage-app*.jar'