[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Re: Perfect Jessie is something like this...



Christian Seiler:
Finally: Upstart also supports  socket activation. It's not quite as
> powerful as systemd's, but is has enough features for this use case.
> I don't know the people developing util-linux, but I could imagine
> them accepting a patch to also support Upstart-style socket
> activation, if one were to write such a patch.
>
> Or, if you want to: a while back I wrote some code to translate init
>  system related stuff between one another. [...]

.. but in doing so you made the oft-made mistake of thinking that there are only two service management systems. Although you did use the slightly unusual variant of thinking that the only two were upstart and systemd. (-: There are actually a lot more service management systems than that, and have been for over a decade and a half. Some of them also support running a socket-using process as a service, with the service management system dealing with the mechanics of creating, binding, listening, and accepting connections on the socket. See http://homepage.ntlworld.com./jonathan.deboynepollard/FGA/run-scripts-and-service-units-side-by-side.html for a side-by-side look at one family of such service management systems.

A run script for uuidd, which would work under daemontools, daemontools-encore, freedt, runit, s6, and the nosh package, using the nosh program as the script interpreter, would look something like:

    #!/bin/nosh
setuidgid uuidd # Do this first, for the security reasons given in local-stream-socket-listen(1) .
    local-stream-socket-listen --systemd-compatibility /run/uuidd/request
    uuidd --socket-activation

The service and socket units in util-linux likewise leave the creation of the directory to something else. But perp, daemontools-encore, and nosh have the capability of running "start" programs. In perp's case it would be in the same, rather differently structured to all of the others, rc.main script as the main daemon. nosh and daemontools-encore use a separate "start" script, where one would perhaps put something like:

    #!/bin/sh -e
    mkdir -m 0755 /run/uuidd
    chown uuidd:uuidd /run/uuidd/

nosh, runit, daemontools, and ucspi-unix can even be installed from pre-built binary Debian packages. s6 binary packaging is awaiting someone to roll up xyr sleeves at Debian #733915. (s6-networking has no binary package that I know of, but I haven't checked thoroughly. Neither have ipsvd or daemontools-encore. One can build them ALL from source, of course.) As noted in the aforementioned side-by-side comparison where it discusses exim: ucspi-unix and s6-networking don't handle listen-only, which is unfortunate for daemons like this one which don't do listen+accept. But as also pointed out in the side-by-side comparison, albeit perhaps not prominently enough, the toolsets can be mixed and matched.


Reply to: