Skip to main content
Topic solved
This topic has been marked as solved and requires no further attention.
Topic: How to create service for programs using <program> start/stop (Read 542 times) previous topic - next topic
0 Members and 2 Guests are viewing this topic.

How to create service for programs using <program> start/stop

I am currently trying to make a service for LanguageTool (for learning runit)
But then I discovered LanguageTool doesn't use a typical format, but a start /stop system:

https://github.com/languagetool-org/languagetool/blob/master/languagetool-rpm-package/src/main/resources/templates/languagetool.service.template

What's the runit equivalent of ExecStart, ExecStop and ExecReload ?

Re: How to create service for programs using <program> start/stop

Reply #1
ExecStart → contents of the run file. Remember that the script must ultimately exec into the service executable, or pause if you can't get it to stay in the foreground.
ExecStop → contents of the control/t file.
ExecReload → contents of the control/h file.

This seems to be the kind of systemd service that won't translate well into runit, though, since it's basically "hey, use this other program to manage the service rather than managing it yourself". Runit works best when it has direct acess to the service process.

Re: How to create service for programs using <program> start/stop

Reply #2
If "ltserver start" stays in the foreground, it should work. You could ignore other parts of this like the reload, pidfile, and so on. If you need ExecStop, you could use a finish file however.

Re: How to create service for programs using <program> start/stop

Reply #3
just found out
Code: [Select]
exec chpst -u languagetool languagetool --http --allow-origin "*" 
works just fine