Tuesday, May 14, 2024
 Popular · Latest · Hot · Upcoming
9
rated 0 times [  9] [ 0]  / answers: 1 / hits: 62329  / 2 Years ago, sun, june 5, 2022, 3:42:36

I've added a new script to /etc/init/ called minecraft.conf which contains the script:



start on startup
stop on shutdown
respawn
respawn limit 20 5

script
export HOME="/root"
exec /root/minecraft/start.sh 2>&1 >> /var/log/minecraft.log
end script

post-start script
echo "minecraft started"


When I try start minecraft I get the error: start: Unknown job: minecraft



I've tried running initctl list and my minecraft job is not listed. I've tried running initctl reload-configuration and it doesn't make any difference.



Other jobs listed by initctl list work fine with start, stop and restart.



Why won't upstart see my new script?


More From » upstart

 Answers
5

I feel kinda dumb... But here it is:



I missed the "end script" stanza from the very end of the upstart script...



post-start script
echo "minecraft started"


should have been



post-start script
echo "minecraft started"
end script


I'm not sure why it worked for @schkovich without the end script, though...


[#33036] Sunday, June 5, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
inciplyies

Total Points: 10
Total Questions: 114
Total Answers: 93

Location: French Polynesia
Member since Sun, Dec 20, 2020
3 Years ago
;