runit service "requires" 26 July 2022, 18:27:44 I am looking at using gunicorn to serve uwsgi unix sock to nginx.I need nginx service to "require" gunicorn service be running.Or Generally: I need Service A to run Service B. --> B "requires" ADoes this exist in runit? Last Edit: 26 July 2022, 18:35:45 by pshaw
Re: runit service "requires" Reply #1 – 26 July 2022, 19:04:53 Not really, despite being popular, runit is the weakest init we offer in terms of features.It does not have builtin dependency handling, which I find annoying.
Re: runit service "requires" Reply #2 – 26 July 2022, 20:20:10 You could add sv start gunicorn || exit 1 as the second line (i.e. after #!/bin/sh and before exec nginx) of nginx's run file, so starting nginx also starts gunicorn. That's the closest thing runit has to dependency handling.Adding a conf script for nginx-runit would be nice for this use case.
Re: runit service "requires" Reply #3 – 26 July 2022, 21:21:31 Quote from: capezotte – on 26 July 2022, 20:20:10You could add sv start gunicorn || exit 1 as the second line (i.e. after #!/bin/sh and before exec nginx) of nginx's run file, so starting nginx also starts gunicorn. That's the closest thing runit has to dependency handling.If you don't want your nginx service to fail and restart until gunicorn is ready (I don't know how fast it starts) you should also provide a good check file so that the sv start[\tt] also actually waits for the service to be ready.Quote from: capezotte – on 26 July 2022, 20:20:10Adding a conf script for nginx-runit would be nice for this use case.Actually we could craft some dependency and configuration management facility in kind of a standard way for all the services, will try to do something. 2 Likes
Re: runit service "requires" Reply #4 – 27 July 2022, 11:58:30 Quote from: qontinuum – on 26 July 2022, 21:21:31Actually we could craft some dependency and configuration management facility in kind of a standard way for all the services, will try to do something.You're spoiling our users...