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

2013-04-12 Thread Zbigniew Jędrzejewski-Szmek
On Fri, Apr 05, 2013 at 07:16:59PM +0200, Lennart Poettering wrote:
 On Wed, 03.04.13 23:12, Zbigniew Jędrzejewski-Szmek (zbys...@in.waw.pl) wrote:
 
   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.
 
 I fully agree with Zbyszek. The order matters enough to show them with
 the original order, but OTOH is too much of an implementation detail
 that should irrelevant to the admin to emphasize it in the output by
 prefixing them with numbering.
 
 BTW, semi-related to this: I wonder if we should add a new set of
 commands to systemctl that lists sockets, timers path units in an
 alternative output mode, i.e. where they aren't ordered by unit names,
 but rather by the resource name the units cover.
 
 For example, for systemctl list-sockets it could do:
 
 LISTEN  UNIT  ACIVATES
 127.0.0.1:4711  foobar.socket foobar.service
 /run/systed/journal waldo.socket  waldo.socket
I pushed something like that. It's a bit bare-bones right now.
A surprising amount of code was requried (300 lines), but adding
smarts should be easy now. I think it would be nice to e.g. show
socket-units listening on external addresses or those activating
services under root in red or something. 

Zbyszek

 And for systemctl list-timers or so it could give a
 break-down of all active timer events with the time the expire next as
 first column. Something
 like this:
 
 NEXTLEFTUNIT ACTIVATES
 2013-06-12 12:34:11 4 months 5 days foobar.timer foobar.service
 2013-05-01 07:31:51 2 months 3 days waldo.timer  waldo.service
 
 (The latter was proposed by viking-ice on the hackfest iirc, all i am
 suggesting is to do the same for sockets and other trigger units)
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


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

2013-04-05 Thread Lennart Poettering
On Wed, 03.04.13 23:12, Zbigniew Jędrzejewski-Szmek (zbys...@in.waw.pl) wrote:

  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.

I fully agree with Zbyszek. The order matters enough to show them with
the original order, but OTOH is too much of an implementation detail
that should irrelevant to the admin to emphasize it in the output by
prefixing them with numbering.

BTW, semi-related to this: I wonder if we should add a new set of
commands to systemctl that lists sockets, timers path units in an
alternative output mode, i.e. where they aren't ordered by unit names,
but rather by the resource name the units cover.

For example, for systemctl list-sockets it could do:

LISTEN  UNIT  ACIVATES
127.0.0.1:4711  foobar.socket foobar.service
/run/systed/journal waldo.socket  waldo.socket

And for systemctl list-timers or so it could give a
break-down of all active timer events with the time the expire next as
first column. Something
like this:

NEXTLEFTUNIT ACTIVATES
2013-06-12 12:34:11 4 months 5 days foobar.timer foobar.service
2013-05-01 07:31:51 2 months 3 days waldo.timer  waldo.service

(The latter was proposed by viking-ice on the hackfest iirc, all i am
suggesting is to do the same for sockets and other trigger units)

Lennart

-- 
Lennart Poettering - Red Hat, Inc.
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


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

2013-04-03 Thread Zbigniew Jędrzejewski-Szmek
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
 zbys...@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
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


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

2013-04-02 Thread Tomasz Torcz
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.

-- 
Tomasz Torcz God, root, what's the difference?
xmpp: zdzich...@chrome.pl God is more forgiving.

___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


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

2013-04-02 Thread Zbigniew Jędrzejewski-Szmek
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.

Zbyszek
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


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

2013-04-02 Thread Kok, Auke-jan H
On Tue, Apr 2, 2013 at 6:29 AM, Zbigniew Jędrzejewski-Szmek
zbys...@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

Cheers,

Auke
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


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

2013-04-01 Thread Zbigniew Jędrzejewski-Szmek
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
 Stream: [::]:
 Stream: 127.0.0.2:9996
 Stream: [::1]:9996
 Datagram: /tmp/stream2
 Datagram: @stream5
 Datagram: [::]:9998
 Datagram: 127.0.0.2:9995
 Datagram: [::1]:9995
 SequentialPacket: @stream6
 SequentialPacket: /tmp/stream3
 FIFO: /tmp/fifo1
 Special: /dev/input/event9
 Netlink: kobject-uevent 0
 MessageQueue: /msgqueue1
Pushed, but format changed to:

listen1.socket - descr descr
 Loaded: loaded (/run/systemd/system/listen1.socket; static)
 Active: failed (Result: resources)
   Docs: man:listen(1)
   : man:listen(1)
   ListenStream: /tmp/stream1
 ListenDatagram: /tmp/stream2
 ListenSequentialPacket: /tmp/stream3
   ListenStream: @stream4
 ListenDatagram: @stream5
 ListenSequentialPacket: @stream6
   ListenStream: [::]:
 ListenDatagram: [::]:9998
   ListenStream: 127.0.0.2:9996
 ListenDatagram: 127.0.0.2:9995
   ListenStream: [::1]:9996
 ListenDatagram: [::1]:9995
 ListenFIFO: /tmp/fifo1
  ListenSpecial: /dev/input/event9
  ListenNetlink: kobject-uevent 0
 ListenMessageQueue: /msgqueue1

Thanks!
Zbyszek
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel