1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
|
'\" t
.TH "SYSTEMD\-SOCKET\-ACTIVATE" "1" "" "systemd 254" "systemd-socket-activate"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.\" http://bugs.debian.org/507673
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH "NAME"
systemd-socket-activate \- Test socket activation of daemons
.SH "SYNOPSIS"
.HP \w'\fBsystemd\-socket\-activate\fR\ 'u
\fBsystemd\-socket\-activate\fR [OPTIONS...] \fIdaemon\fR [OPTIONS...]
.SH "DESCRIPTION"
.PP
\fBsystemd\-socket\-activate\fR
may be used to launch a socket\-activated service program from the command line for testing purposes\&. It may also be used to launch individual instances of the service program per connection\&.
.PP
The daemon to launch and its options should be specified after options intended for
\fBsystemd\-socket\-activate\fR\&.
.PP
If the
\fB\-\-inetd\fR
option is given, the socket file descriptor will be used as the standard input and output of the launched process\&. Otherwise, standard input and output will be inherited, and sockets will be passed through file descriptors 3 and higher\&. Sockets passed through
\fI$LISTEN_FDS\fR
to
\fBsystemd\-socket\-activate\fR
will be passed through to the daemon, in the original positions\&. Other sockets specified with
\fB\-\-listen=\fR
will use consecutive descriptors\&. By default,
\fBsystemd\-socket\-activate\fR
listens on a stream socket, use
\fB\-\-datagram\fR
and
\fB\-\-seqpacket\fR
to listen on datagram or sequential packet sockets instead (see below)\&.
.SH "OPTIONS"
.PP
\fB\-l \fR\fB\fIaddress\fR\fR, \fB\-\-listen=\fR\fB\fIaddress\fR\fR
.RS 4
Listen on this
\fIaddress\fR\&. Takes a string like
"2000"
or
"127\&.0\&.0\&.1:2001"\&.
.RE
.PP
\fB\-a\fR, \fB\-\-accept\fR
.RS 4
Launch an instance of the service program for each connection and pass the connection socket\&.
.RE
.PP
\fB\-d\fR, \fB\-\-datagram\fR
.RS 4
Listen on a datagram socket (\fBSOCK_DGRAM\fR), instead of a stream socket (\fBSOCK_STREAM\fR)\&. May not be combined with
\fB\-\-seqpacket\fR\&.
.RE
.PP
\fB\-\-seqpacket\fR
.RS 4
Listen on a sequential packet socket (\fBSOCK_SEQPACKET\fR), instead of a stream socket (\fBSOCK_STREAM\fR)\&. May not be combined with
\fB\-\-datagram\fR\&.
.RE
.PP
\fB\-\-inetd\fR
.RS 4
Use the inetd protocol for passing file descriptors, i\&.e\&. as standard input and standard output, instead of the new\-style protocol for passing file descriptors using
\fI$LISTEN_FDS\fR
(see above)\&.
.RE
.PP
\fB\-E \fR\fB\fIVAR\fR\fR\fB[=\fIVALUE\fR]\fR, \fB\-\-setenv=\fR\fB\fIVAR\fR\fR\fB[=\fIVALUE\fR]\fR
.RS 4
Add this variable to the environment of the launched process\&. If
\fIVAR\fR
is followed by
"=", assume that it is a variable\(envalue pair\&. Otherwise, obtain the value from the environment of
\fBsystemd\-socket\-activate\fR
itself\&.
.RE
.PP
\fB\-\-fdname=\fR\fINAME\fR[:\fINAME\fR\&...]
.RS 4
Specify names for the file descriptors passed\&. This is equivalent to setting
\fIFileDescriptorName=\fR
in socket unit files, and enables use of
\fBsd_listen_fds_with_names\fR(3)\&. Multiple entries may be specifies using separate options or by separating names with colons (":") in one option\&. In case more names are given than descriptors, superfluous ones will be ignored\&. In case less names are given than descriptors, the remaining file descriptors will be unnamed\&.
.RE
.PP
\fB\-h\fR, \fB\-\-help\fR
.RS 4
Print a short help text and exit\&.
.RE
.PP
\fB\-\-version\fR
.RS 4
Print a short version string and exit\&.
.RE
.SH "ENVIRONMENT VARIABLES"
.PP
\fI$LISTEN_FDS\fR, \fI$LISTEN_PID\fR, \fI$LISTEN_FDNAMES\fR
.RS 4
See
\fBsd_listen_fds\fR(3)\&.
.RE
.PP
\fI$SYSTEMD_LOG_TARGET\fR, \fI$SYSTEMD_LOG_LEVEL\fR, \fI$SYSTEMD_LOG_TIME\fR, \fI$SYSTEMD_LOG_COLOR\fR, \fI$SYSTEMD_LOG_LOCATION\fR
.RS 4
Same as in
\fBsystemd\fR(1)\&.
.RE
.SH "EXAMPLES"
.PP
\fBExample\ \&1.\ \&Run an echo server on port 2000\fR
.sp
.if n \{\
.RS 4
.\}
.nf
$ systemd\-socket\-activate \-l 2000 \-\-inetd \-a cat
.fi
.if n \{\
.RE
.\}
.PP
\fBExample\ \&2.\ \&Run a socket\-activated instance of systemd-journal-gatewayd(8)\fR
.sp
.if n \{\
.RS 4
.\}
.nf
$ systemd\-socket\-activate \-l 19531 /usr/lib/systemd/systemd\-journal\-gatewayd
.fi
.if n \{\
.RE
.\}
.SH "SEE ALSO"
.PP
\fBsystemd\fR(1),
\fBsystemd.socket\fR(5),
\fBsystemd.service\fR(5),
\fBsystemd-run\fR(1),
\fBsd_listen_fds\fR(3),
\fBsd_listen_fds_with_names\fR(3),
\fBcat\fR(1)
|