1SYSTEMD-SOCKET-ACTIVATE(1) systemd-socket-activate SYSTEMD-SOCKET-ACTIVATE(1)
2
3
4
6 systemd-socket-activate - Test socket activation of daemons
7
9 systemd-socket-activate [OPTIONS...] daemon [OPTIONS...]
10
12 systemd-socket-activate may be used to launch a socket-activated
13 service program from the command line for testing purposes. It may also
14 be used to launch individual instances of the service program per
15 connection.
16
17 The daemon to launch and its options should be specified after options
18 intended for systemd-socket-activate.
19
20 If the --inetd option is given, the socket file descriptor will be used
21 as the standard input and output of the launched process. Otherwise,
22 standard input and output will be inherited, and sockets will be passed
23 through file descriptors 3 and higher. Sockets passed through
24 $LISTEN_FDS to systemd-socket-activate will be passed through to the
25 daemon, in the original positions. Other sockets specified with
26 --listen= will use consecutive descriptors. By default,
27 systemd-socket-activate listens on a stream socket, use --datagram and
28 --seqpacket to listen on datagram or sequential packet sockets instead
29 (see below).
30
32 -l address, --listen=address
33 Listen on this address. Takes a string like "2000" or
34 "127.0.0.1:2001".
35
36 -a, --accept
37 Launch an instance of the service program for each connection and
38 pass the connection socket.
39
40 -d, --datagram
41 Listen on a datagram socket (SOCK_DGRAM), instead of a stream
42 socket (SOCK_STREAM). May not be combined with --seqpacket.
43
44 --seqpacket
45 Listen on a sequential packet socket (SOCK_SEQPACKET), instead of a
46 stream socket (SOCK_STREAM). May not be combined with --datagram.
47
48 --inetd
49 Use the inetd protocol for passing file descriptors, i.e. as
50 standard input and standard output, instead of the new-style
51 protocol for passing file descriptors using $LISTEN_FDS (see
52 above).
53
54 -E VAR[=VALUE], --setenv=VAR[=VALUE]
55 Add this variable to the environment of the launched process. If
56 VAR is followed by "=", assume that it is a variable–value pair.
57 Otherwise, obtain the value from the environment of
58 systemd-socket-activate itself.
59
60 --fdname=NAME[:NAME...]
61 Specify names for the file descriptors passed. This is equivalent
62 to setting FileDescriptorName= in socket unit files, and enables
63 use of sd_listen_fds_with_names(3). Multiple entries may be
64 specifies using separate options or by separating names with colons
65 (":") in one option. In case more names are given than descriptors,
66 superfluous ones will be ignored. In case less names are given than
67 descriptors, the remaining file descriptors will be unnamed.
68
69 -h, --help
70 Print a short help text and exit.
71
72 --version
73 Print a short version string and exit.
74
76 $LISTEN_FDS, $LISTEN_PID, $LISTEN_FDNAMES
77 See sd_listen_fds(3).
78
79 $SYSTEMD_LOG_TARGET, $SYSTEMD_LOG_LEVEL, $SYSTEMD_LOG_TIME,
80 $SYSTEMD_LOG_COLOR, $SYSTEMD_LOG_LOCATION
81 Same as in systemd(1).
82
84 Example 1. Run an echo server on port 2000
85
86 $ systemd-socket-activate -l 2000 --inetd -a cat
87
88 Example 2. Run a socket-activated instance of systemd-journal-
89 gatewayd(8)
90
91 $ systemd-socket-activate -l 19531 /usr/lib/systemd/systemd-journal-gatewayd
92
94 systemd(1), systemd.socket(5), systemd.service(5), systemd-run(1),
95 sd_listen_fds(3), sd_listen_fds_with_names(3), cat(1)
96
97
98
99systemd 250 SYSTEMD-SOCKET-ACTIVATE(1)