[systemd-devel] Questions about socket activated services
teg at jklm.no
Sat May 30 15:59:02 PDT 2015
On Sat, May 30, 2015 at 3:36 PM, cee1 <fykcee1 at gmail.com> 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'.
> 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
> Curious why?
> - cee1
> systemd-devel mailing list
> systemd-devel at lists.freedesktop.org
More information about the systemd-devel