Re: [systemd-devel] Questions about socket activated services

2015-05-30 Thread Tom Gundersen
On Sat, May 30, 2015 at 3:36 PM, cee1  wrote:
> Which service type should a socket activated service be?
> 1. For systemd-udevd.service and systemd-journald.service, they are notify 
> type
> 2. For dbus.service, it is simple type

A service can be of type 'simple' if all that other services care
about that order themselves after it is that the sockets are available
(which they will always be as they are started by PID1 early on).
However, if the service in question does more work at startup that
other services want to wait for, then it needs to be of type 'notify',
and notify PID1 once it is ready. In the case of udev the work it
needs to do at startup is to apply permission to static device nodes
(you want to guarantee that this has finished before starting
follow-up services), if it had not been for that udev too could have
been of type 'simple'.

HTH,

Tom

> Does socket activation handles the timeout case?
> E.g. A.service connects to B.socket, but B.service spends a long time
> to be ready, may cause A.service receives ETIMEDOUT?
>
> When the service is activated, systemd will still listen to the socket
> but do nothing for incoming data, right?
>
> BTW, netstat -lp shows only systemd is listening to a socket, but not
> show the one who also is listening to the socket, e.g.
> """
> unix  2  [ ACC ] SEQPACKET  LISTENING 326  1/systemd
>  /run/udev/control
> """
> Curious why?
>
>
>
> --
> Regards,
>
> - cee1
> ___
> systemd-devel mailing list
> systemd-devel@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/systemd-devel
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] Questions about socket activated services

2015-05-30 Thread Andrei Borzenkov
В Sat, 30 May 2015 21:36:02 +0800
cee1  пишет:

> Hi all,
> 
> Which service type should a socket activated service be?
> 1. For systemd-udevd.service and systemd-journald.service, they are notify 
> type
> 2. For dbus.service, it is simple type
> 

It can be any type. notify is always preferred if started program
supports it.

> Does socket activation handles the timeout case?
> E.g. A.service connects to B.socket, but B.service spends a long time
> to be ready, may cause A.service receives ETIMEDOUT?
> 

I suppose it is possible with Accept=false. With Accept=true connection
is accepted by systemd itself.

> When the service is activated, systemd will still listen to the socket
> but do nothing for incoming data, right?
> 

Yes for Accept=false. For Accept=true it is always systemd which accepts
connection.

> BTW, netstat -lp shows only systemd is listening to a socket, but not
> show the one who also is listening to the socket, e.g.
> """
> unix  2  [ ACC ] SEQPACKET  LISTENING 326  1/systemd
>  /run/udev/control
> """
> Curious why?
> 

I think it is more netstat issue, apparently it shows the first process
it finds.

> 
> 

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


[systemd-devel] Questions about socket activated services

2015-05-30 Thread cee1
Hi all,

Which service type should a socket activated service be?
1. For systemd-udevd.service and systemd-journald.service, they are notify type
2. For dbus.service, it is simple type

Does socket activation handles the timeout case?
E.g. A.service connects to B.socket, but B.service spends a long time
to be ready, may cause A.service receives ETIMEDOUT?

When the service is activated, systemd will still listen to the socket
but do nothing for incoming data, right?

BTW, netstat -lp shows only systemd is listening to a socket, but not
show the one who also is listening to the socket, e.g.
"""
unix  2  [ ACC ] SEQPACKET  LISTENING 326  1/systemd
 /run/udev/control
"""
Curious why?



-- 
Regards,

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