[systemd-devel] [PATCH] [RFCv4] Add Listen* to dbus properties

Zbigniew Jędrzejewski-Szmek zbyszek at in.waw.pl
Wed Apr 3 14:12:27 PDT 2013


On Tue, Apr 02, 2013 at 10:42:46AM -0700, Kok, Auke-jan H wrote:
> On Tue, Apr 2, 2013 at 6:29 AM, Zbigniew Jędrzejewski-Szmek
> <zbyszek at in.waw.pl> wrote:
> > On Tue, Apr 02, 2013 at 08:26:17AM +0200, Tomasz Torcz wrote:
> >> On Tue, Apr 02, 2013 at 05:54:32AM +0200, Zbigniew Jędrzejewski-Szmek wrote:
> >> > On Mon, Apr 01, 2013 at 11:09:45PM +0300, Oleksii Shevchuk wrote:
> >> > > sockets.socket - Test
> >> > >     Loaded: loaded (/home/alxchk/.config/systemd/user/sockets.socket; static)
> >> > >     Active: inactive (dead)
> >> > >     Listen: Stream: /tmp/stream1
> >> > >             Stream: @stream4
> >> > Pushed, but format changed to:
> >> >
> >> > listen1.socket - descr descr
> >> >                  Loaded: loaded (/run/systemd/system/listen1.socket; static)
> >> >                  Active: failed (Result: resources)
> >> >            ListenStream: /tmp/stream1
> >> >          ListenDatagram: /tmp/stream2
> >>
> >>   I must say I liked per-type grouping better.
> > It *looked* better, but the ordering of sockets is important: it determines
> > the order of fd's for the .service. For some applications it might not matter,
> > but for simple ones it might, so it's better to preserve this information.
> 
> If ordering is important, the output should reflect the ordering. The
> only way I can see that you could accomplish that unambiguously is by
> numbering them. Sorting them will just leave people puzzled as to what
> the order is.
> 
> So, consider adding some form of numbering to the list of listen
> addresses. Perhaps something like:
> 
> >> >            0: ListenStream: /tmp/stream1
> >> >            1: ListenDatagram: /tmp/stream2
Hi,
I forgot to reply to this, and just remembered looking at Lennart's TODO prunning.

Numbering from 0 (or 1) would be misleading, because the sockets
get passed as 3, 4, etc. But numbering from 3 would be misleading
too, because when more than one .socket is used, the fd's from the
second .socket and subsequent ones are shifted. I don't think that
there's a way to sanely number those sockets without complicating
things significantly. Also, it wouldn't fit the current layout scheme :)
OTOH, just counting them by hand should be easy enough. I think
that having more than one or two is quite rare.

Zbyszek


More information about the systemd-devel mailing list