你们能帮忙使用 Upstart 脚本吗?
由于某种原因,它无法停止 java 进程service something stop
。
服务状态说bbb stop/waiting
我正在尝试运行我的应用程序,它是 jar 文件(java)。
以下是我的脚本的样子
description "BBB API service"
# no start option as you might not want it to auto-start
# This might not be supported - you might need a: start on runlevel [3]
start on runlevel [3]
stop on runlevel [!2345]
# stop on shutdown
# if you want it to automatically restart if it crashes, leave the next line in
respawn
script
cd /home/ubuntu/bbb-server/target
su -c "/usr/bin/java -jar /home/ubuntu/bbb-server/target/api_standalone.jar" nobody
end script