The officially official Devuan Forum!

You are not logged in.

#1 2019-07-02 18:28:56

viverna
Member
Registered: 2017-07-02
Posts: 31  

Runit service depend another script not daemon

I'm not an expert of Runit and I want ask you how make a service depend another script not daemon.
For example if I have a service that needs another service:

cat /etc/service/my_service/run
#!/bin/sh
sv start service_required || exit 1
exec my_service

But if "service_required" is not a daemon?

For example run ssh daemon is required bring a network interface up.
Bring a network interface up is accomplished from a simple/very few command/s such as ifup and friend.
ifup execute and terminate, and execute again forever.

I have found a ugly solution. Declare "sv once not-daemon" in the script.
Or a very ugly solution: while true; do; read VAR; done and a trap on TERM signal that execute final command
(for example ifdown -a at exit).

Browsing around seems distro put it in stage 1. It's the cleanest solution... but how to do if I want intersperse
daemon and not daemon and define for example a cascade of dependencies like this:
service1 (daemon) depends script (not daemon) depends service2 (daemon)?

Offline

Board footer