Index · Directives · Python · libudev · gudev systemd 212

systemd.daemon module

daemon.LISTEN_FDS_START = 3
systemd.daemon._listen_fds(unset_environment=True) → int

Return the number of descriptors passed to this process by the init system as part of the socket-based activation logic. Wraps sd_listen_fds(3).

systemd.daemon._is_fifo(fd, path) → bool

Returns True iff the descriptor refers to a FIFO or a pipe. Wraps sd_is_fifo(3).

systemd.daemon._is_socket(fd, family=AF_UNSPEC, type=0, listening=-1) → bool

Returns True iff the descriptor refers to a socket. Wraps sd_is_socket(3).

Constants for family are defined in the socket module.

systemd.daemon._is_socket_unix(fd, type, listening, path) → bool

Wraps sd_is_socket_unix(3).

systemd.daemon._is_socket_inet(fd, family=AF_UNSPEC, type=0, listening=-1, port=0) → bool

Wraps sd_is_socket_inet(3).

Constants for family are defined in the socket module.

systemd.daemon._is_mq(fd, path) → bool

Returns True iff the descriptor refers to a POSIX message queue. Wraps sd_is_mq(3).

systemd.daemon.notify(status, unset_environment=False) → bool

Send a message to the init system about a status change. Wraps sd_notify(3).

systemd.daemon.booted() → bool

Return True iff this system is running under systemd. Wraps sd_daemon_booted(3).

systemd.daemon.is_fifo(fileobj, path=None)[source]
systemd.daemon.is_mq(fileobj, path=None)[source]
systemd.daemon.is_socket(fileobj, family=0, type=0, listening=-1)[source]
systemd.daemon.is_socket_inet(fileobj, family=0, type=0, listening=-1, port=0)[source]
systemd.daemon.is_socket_unix(fileobj, type=0, listening=-1, path=None)[source]
systemd.daemon.listen_fds(unset_environment=True)[source]

Return a list of socket activated descriptors

Example:

(in primary window)
$ systemd-activate -l 2000 python3 -c \
    'from systemd.daemon import listen_fds; print(listen_fds())'
(in another window)
$ telnet localhost 2000
(in primary window)
...
Execing python3 (...)
[3]

Previous topic

systemd.id128 module

Next topic

systemd.login module