:: Re: [DNG] Runit service depend anot…
Top Pagina
Delete this message
Reply to this message
Auteur: viverna
Datum:  
Aan: dng
Onderwerp: Re: [DNG] Runit service depend another script not daemon
il devuanizzato Steve Litt <slitt@???> il 03-07-19
01:09:55 ha scritto:
>On Tue, 2 Jul 2019 20:28:51 +0200
>viverna <viverna@???> wrote:
>
>> I'm not an expert of Runit and I want ask you how make a service
>> depend another script not daemon.
>Hi viverna,

Hi Steve Litt, thanks for the reply.

>I'm not quite sure what you're trying to accomplish, but if

I'm playing with runit mainly because I like to study new things and
because I'd like to have various init system installed in my machine
and script/config file related for all daemon.

I think that users wants, like me, when they installed a daemon with
apt and friends script/config file created for all init system
installed.

Ideally it is possible to make this executing a script on event
"DPkg::Post-Invoke" and copy script/config file in proper directory.

I have already written a simple posix shell script that works in my
computer with epoch init system, but I need help because code is
written in my spare time (very little time) and need coder better than
me.

Finally for all init system supported there will be:
- a package for init system (for example runit)
- a complete collection of script/config file (for example
runit-init-collection-script) in a proper format
- above script copy/delete script/config file in the correct directory.

I don't know if this can be a feasible solution for to ensure init
freedom. What do you think?

>If service_required should still be running when my_service starts up,
>then service_required should have its own /etc/sv/service_required and
>the symlink in /var/service, and a test should be devised to determine
>whether service_required is functional. Let's say that test is
>contained in a shellscript called service_required_is_functional, that
>returns 0 when the service proves it's functioning, and some other
>number otherwise (I use 1). Then the run script for my_service looks
>like this:
>
>#!/bin/sh
>if service_required_is_functional; then
> exec my_service
>fi
>sleep 1

Very interesting. Simple and useful. I will try your solution as soon
as I have time available.

--
viverna