Re: C API for service management

From: Steve Litt <slitt_at_troubleshooters.com>
Date: Tue, 19 Jan 2016 19:03:49 -0500

On Tue, 19 Jan 2016 18:44:54 +0100
Jan Olszak <jan.olszak_at_vestiacom.com> wrote:

> Hi!
> I'm developing a daemon that will:
> - start/stop
> - send signals
> - check status
> of some services.
>
> This can be done via s6-svc or s6-svstat but:
> 1. Can I use the underlying calls from libs6?
> 2. Is this interface likely to change?

I use runit, but as I remember from the little s6 that I did, s6 is
functionally speaking a superset of runit.

If I were going to develop a daemon like you suggest, I'd just use the
executables bestowed by the process supervisor. For instance:

Start = sv up servicename
stop = sv down servicename
restart = sv down servicename;sv up servicename
status check = sv status servicename

The output of sv status can be parsed to get whether it's running, and
if so its PID so you can use kill to send it the desired signal.

Why can't your daemon be a simple shellscript?

SteveT

Steve Litt
January 2016 featured book: Twenty Eight Tales of Troubleshooting
http://www.troubleshooters.com/28
Received on Wed Jan 20 2016 - 00:03:49 UTC

This archive was generated by hypermail 2.3.0 : Sun May 09 2021 - 19:44:19 UTC