2014-11-21 22:44:48 +03:00
<?xml version='1.0'?> <!-- * - Mode: nxml; nxml - child - indent: 2; indent - tabs - mode: nil - * -->
2013-02-23 20:52:04 +04:00
< !DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
<!--
2015-02-11 07:19:26 +03:00
This file is part of systemd.
2013-02-23 20:52:04 +04:00
2015-02-11 07:19:26 +03:00
Copyright 2013 Zbigniew Jędrzejewski-Szmek
2013-02-23 20:52:04 +04:00
2015-02-11 07:19:26 +03:00
systemd is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 2.1 of the License, or
(at your option) any later version.
2013-02-23 20:52:04 +04:00
2015-02-11 07:19:26 +03:00
systemd is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
2013-02-23 20:52:04 +04:00
2015-02-11 07:19:26 +03:00
You should have received a copy of the GNU Lesser General Public License
along with systemd; If not, see <http: / / w w w . g n u . o r g / l i c e n s e s /> .
2013-02-23 20:52:04 +04:00
-->
2014-02-13 23:33:51 +04:00
<refentry id= "systemd-activate"
xmlns:xi="http://www.w3.org/2001/XInclude">
2013-02-23 20:52:04 +04:00
<refentryinfo >
<title > systemd-activate</title>
<productname > systemd</productname>
<authorgroup >
<author >
<contrib > Developer</contrib>
<firstname > Zbigniew</firstname>
<surname > Jędrzejewski-Szmek</surname>
<email > zbyszek@in.waw.pl</email>
</author>
</authorgroup>
</refentryinfo>
<refmeta >
<refentrytitle > systemd-activate</refentrytitle>
<manvolnum > 8</manvolnum>
</refmeta>
<refnamediv >
<refname > systemd-activate</refname>
<refpurpose > Test socket activation of daemons</refpurpose>
</refnamediv>
<refsynopsisdiv >
<cmdsynopsis >
<command > /usr/lib/systemd/systemd-activate</command>
<arg choice= "opt" rep= "repeat" > OPTIONS</arg>
<arg choice= "plain" > <replaceable > daemon</replaceable> </arg>
<arg choice= "opt" rep= "repeat" > OPTIONS</arg>
</cmdsynopsis>
</refsynopsisdiv>
<refsect1 >
<title > Description</title>
<para > <command > systemd-activate</command> can be used to
2014-11-06 22:06:30 +03:00
launch a socket activated daemon from the command line for
2013-02-23 20:52:04 +04:00
testing purposes. It can also be used to launch single instances
of the daemon per connection (inetd-style).
</para>
<para > The daemon to launch and its options should be specifed
after options intended for <command > systemd-activate</command> .
</para>
<para > If the <option > -a</option> option is given, file descriptor
of the connection 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 <varname > $LISTEN_FDS</varname>
to <command > systemd-activate</command> will be passed through to
the dameon, in the original positions. Other sockets specified
with <option > --listen</option> will use consecutive descriptors.
</para>
</refsect1>
<refsect1 >
<title > Options</title>
<variablelist >
<varlistentry >
2013-03-16 02:57:44 +04:00
<term > <option > -l <replaceable > address</replaceable> </option> </term>
2013-02-23 20:52:04 +04:00
<term > <option > --listen=<replaceable > address</replaceable> </option> </term>
<listitem > <para > Listen on this <replaceable > address</replaceable> .
Takes a string like <literal > 2000</literal> or
<literal > 127.0.0.1:2001</literal> .</para>
</listitem>
</varlistentry>
<varlistentry >
<term > <option > -a</option> </term>
<term > <option > --accept</option> </term>
<listitem > <para > Launch a separate instance of daemon per
connection and pass the connection socket as standard input
and standard output.</para> </listitem>
</varlistentry>
2013-03-16 02:57:44 +04:00
<varlistentry >
<term > <option > -E <replaceable > VAR</replaceable> <optional > =<replaceable > VALUE</replaceable> </optional> </option> </term>
2013-12-29 23:56:09 +04:00
<term > <option > --setenv=<replaceable > VAR</replaceable> <optional > =<replaceable > VALUE</replaceable> </optional> </option> </term>
2013-03-16 02:57:44 +04:00
<listitem > <para > Add this variable to the environment of the
launched process. If <replaceable > VAR</replaceable> is
2013-09-12 23:12:49 +04:00
followed by <literal > =</literal> , assume that it is a
variable– value pair. Otherwise, obtain the value from the
2013-03-16 02:57:44 +04:00
environment of <command > systemd-activate</command> itself.
</para> </listitem>
</varlistentry>
2014-02-13 23:33:51 +04:00
<xi:include href= "standard-options.xml" xpointer= "help" />
<xi:include href= "standard-options.xml" xpointer= "version" />
2013-02-23 20:52:04 +04:00
</variablelist>
</refsect1>
<refsect1 >
<title > Environment variables</title>
<variablelist class= 'environment-variables' >
<varlistentry >
<term > <varname > $LISTEN_FDS</varname> </term>
<term > <varname > $LISTEN_PID</varname> </term>
2013-02-28 07:38:26 +04:00
<listitem > <para > See
<citerefentry > <refentrytitle > sd_listen_fds</refentrytitle> <manvolnum > 3</manvolnum> </citerefentry> .</para> </listitem>
2013-02-23 20:52:04 +04:00
</varlistentry>
<varlistentry >
<term > <varname > $SYSTEMD_LOG_TARGET</varname> </term>
<term > <varname > $SYSTEMD_LOG_LEVEL</varname> </term>
<term > <varname > $SYSTEMD_LOG_COLOR</varname> </term>
<term > <varname > $SYSTEMD_LOG_LOCATION</varname> </term>
2013-02-28 07:38:26 +04:00
<listitem > <para > Same as in
<citerefentry > <refentrytitle > systemd</refentrytitle> <manvolnum > 1</manvolnum> </citerefentry> .</para> </listitem>
2013-02-23 20:52:04 +04:00
</varlistentry>
</variablelist>
</refsect1>
<refsect1 >
2014-10-12 02:37:23 +04:00
<title > Examples</title>
2013-02-23 20:52:04 +04:00
2014-10-12 02:37:23 +04:00
<example >
<title > Run an echo server on port 2000</title>
2013-02-23 20:52:04 +04:00
2014-10-12 02:37:23 +04:00
<programlisting > $ /usr/lib/systemd/systemd-activate -l 2000 -a cat</programlisting>
</example>
2013-02-23 20:52:04 +04:00
2014-10-12 02:37:23 +04:00
<example >
<title > Run a socket activated instance of <citerefentry > <refentrytitle > systemd-journal-gatewayd</refentrytitle> <manvolnum > 8</manvolnum> </citerefentry> </title>
2013-02-23 20:52:04 +04:00
2014-10-12 02:37:23 +04:00
<programlisting > $ /usr/lib/systemd/systemd-activate -l 19531 /usr/lib/systemd/systemd-journal-gatewayd</programlisting>
</example>
2013-02-23 20:52:04 +04:00
</refsect1>
<refsect1 >
<title > See Also</title>
<para >
<citerefentry > <refentrytitle > systemd</refentrytitle> <manvolnum > 1</manvolnum> </citerefentry> ,
<citerefentry > <refentrytitle > systemd.socket</refentrytitle> <manvolnum > 5</manvolnum> </citerefentry> ,
<citerefentry > <refentrytitle > systemd.service</refentrytitle> <manvolnum > 5</manvolnum> </citerefentry> ,
2015-03-14 05:22:39 +03:00
<citerefentry project= 'man-pages' > <refentrytitle > cat</refentrytitle> <manvolnum > 1</manvolnum> </citerefentry>
2013-02-23 20:52:04 +04:00
</para>
</refsect1>
</refentry>