Promote systemd-activate to /usr/bin/systemd-socket-activate
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Fri, 12 Feb 2016 03:11:33 +0000 (22:11 -0500)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Mon, 15 Feb 2016 01:33:32 +0000 (20:33 -0500)
It has fairly wide functionality now and the interface has been
stable for a while. It it a useful testing tool.

The name is changed to better indicate what it does.

.gitignore
Makefile-man.am
Makefile.am
NEWS
man/systemd-activate.xml [deleted file]
man/systemd-socket-activate.xml [new file with mode: 0644]

index cc24233ab8893af8fe3def55d47357ae5da2b633..4ac63a4e2844708a7ca3b093c38d4254a4ae8cf1 100644 (file)
@@ -49,7 +49,6 @@
 /systemctl
 /systemd
 /systemd-ac-power
-/systemd-activate
 /systemd-analyze
 /systemd-ask-password
 /systemd-backlight
 /systemd-run
 /systemd-shutdown
 /systemd-sleep
+/systemd-socket-activate
 /systemd-socket-proxyd
 /systemd-stdio-bridge
 /systemd-sysctl
index 28b5fb6adb937b2eedaf7cd31a73123cd7ae6711..f4c9edc42c715eb8f1c79e5b0ae74d2cc3c63b15 100644 (file)
@@ -94,7 +94,6 @@ MANPAGES += \
        man/shutdown.8 \
        man/sysctl.d.5 \
        man/systemctl.1 \
-       man/systemd-activate.8 \
        man/systemd-analyze.1 \
        man/systemd-ask-password-console.service.8 \
        man/systemd-ask-password.1 \
@@ -126,6 +125,7 @@ MANPAGES += \
        man/systemd-resolve.1 \
        man/systemd-run.1 \
        man/systemd-sleep.conf.5 \
+       man/systemd-socket-activate.1 \
        man/systemd-socket-proxyd.8 \
        man/systemd-suspend.service.8 \
        man/systemd-sysctl.service.8 \
@@ -2574,7 +2574,6 @@ EXTRA_DIST += \
        man/standard-options.xml \
        man/sysctl.d.xml \
        man/systemctl.xml \
-       man/systemd-activate.xml \
        man/systemd-analyze.xml \
        man/systemd-ask-password-console.service.xml \
        man/systemd-ask-password.xml \
@@ -2628,6 +2627,7 @@ EXTRA_DIST += \
        man/systemd-rfkill.service.xml \
        man/systemd-run.xml \
        man/systemd-sleep.conf.xml \
+       man/systemd-socket-activate.xml \
        man/systemd-socket-proxyd.xml \
        man/systemd-suspend.service.xml \
        man/systemd-sysctl.service.xml \
index 676d97c7d467614ee2e5d29e8bdf194e2d8e29bf..da94b502a37a42dc30f28b009308ff9ab4b9062b 100644 (file)
@@ -3875,13 +3875,13 @@ tests += \
 
 # ------------------------------------------------------------------------------
 
-rootlibexec_PROGRAMS += \
-       systemd-activate
+bin_PROGRAMS += \
+       systemd-socket-activate
 
-systemd_activate_SOURCES = \
+systemd_socket_activate_SOURCES = \
        src/activate/activate.c
 
-systemd_activate_LDADD = \
+systemd_socket_activate_LDADD = \
        libshared.la
 
 # ------------------------------------------------------------------------------
diff --git a/NEWS b/NEWS
index 265847c7bdba84beb1e2fbbe79cd241e5db4405e..80e59c53d39ed59116c6a828081264949644ccb0 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,5 +1,11 @@
 systemd System and Service Manager
 
+CHANGES WITH 230 in spe:
+
+        * Testing tool /usr/lib/systemd/systemd-activate is renamed to
+          systemd-socket-activate and installed into /usr/bin. It is now fully
+          supported.
+
 CHANGES WITH 229:
 
         * The systemd-resolved DNS resolver service has gained a substantial
diff --git a/man/systemd-activate.xml b/man/systemd-activate.xml
deleted file mode 100644 (file)
index a8e17f2..0000000
+++ /dev/null
@@ -1,206 +0,0 @@
-<?xml version='1.0'?> <!--*- Mode: nxml; nxml-child-indent: 2; indent-tabs-mode: nil -*-->
-<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
-"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
-
-<!--
-  This file is part of systemd.
-
-  Copyright 2013 Zbigniew Jędrzejewski-Szmek
-
-  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.
-
-  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.
-
-  You should have received a copy of the GNU Lesser General Public License
-  along with systemd; If not, see <http://www.gnu.org/licenses/>.
--->
-
-<refentry id="systemd-activate"
-          xmlns:xi="http://www.w3.org/2001/XInclude">
-
-  <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> may be used to launch a socket-activated service binary from the command
-    line for testing purposes. It may also be used to launch individual instances of the service binary per connection.
-    </para>
-
-    <para>The daemon to launch and its options should be specified
-    after options intended for <command>systemd-activate</command>.
-    </para>
-
-    <para>If the <option>--inetd</option> 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 <varname>$LISTEN_FDS</varname> to
-    <command>systemd-activate</command> will be passed through to the daemon, in the original positions. Other sockets
-    specified with <option>--listen=</option> will use consecutive descriptors.  By default,
-    <command>systemd-activate</command> listens on a stream socket, use <option>--datagram</option> and
-    <option>--seqpacket</option> to listen on datagram or sequential packet sockets instead (see below).
-    </para>
-  </refsect1>
-
-  <refsect1>
-    <title>Options</title>
-    <variablelist>
-      <varlistentry>
-        <term><option>-l <replaceable>address</replaceable></option></term>
-        <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 an instance of the service binary for each connection and pass the connection
-        socket.</para></listitem>
-      </varlistentry>
-
-      <varlistentry>
-        <term><option>-d</option></term>
-        <term><option>--datagram</option></term>
-
-        <listitem><para>Listen on a datagram socket (<constant>SOCK_DGRAM</constant>), instead of a stream socket
-        (<constant>SOCK_STREAM</constant>). May not be combined with <option>--seqpacket</option>.</para></listitem>
-      </varlistentry>
-
-      <varlistentry>
-        <term><option>--seqpacket</option></term>
-
-        <listitem><para>Listen on a sequential packet socket (<constant>SOCK_SEQPACKET</constant>), instead of a stream
-        socket (<constant>SOCK_STREAM</constant>). May not be combined with
-        <option>--datagram</option>.</para></listitem>
-      </varlistentry>
-
-      <varlistentry>
-        <term><option>--inetd</option></term>
-
-        <listitem><para>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 <varname>$LISTEN_FDS</varname>
-        (see above).</para></listitem>
-      </varlistentry>
-
-      <varlistentry>
-        <term><option>-E <replaceable>VAR</replaceable><optional>=<replaceable>VALUE</replaceable></optional></option></term>
-        <term><option>--setenv=<replaceable>VAR</replaceable><optional>=<replaceable>VALUE</replaceable></optional></option></term>
-
-        <listitem><para>Add this variable to the environment of the
-        launched process. If <replaceable>VAR</replaceable> is
-        followed by <literal>=</literal>, assume that it is a
-        variable–value pair. Otherwise, obtain the value from the
-        environment of <command>systemd-activate</command> itself.
-        </para></listitem>
-      </varlistentry>
-
-      <varlistentry>
-        <term><option>--fdname=</option><replaceable>NAME</replaceable><optional>:<replaceable>NAME</replaceable>...</optional></term>
-
-        <listitem><para>Specify names for the file descriptors passed. This is equivalent to setting
-        <varname>FileDescriptorName=</varname> in socket unit files, and enables use of
-        <citerefentry><refentrytitle>sd_listen_fds_with_names</refentrytitle><manvolnum>3</manvolnum></citerefentry>.
-        Multiple entries may be specifies using separate options or by separating names with colons
-        (<literal>:</literal>) in one option. In case more names are given than descriptors, superflous ones willl be
-        ignored. In case less names are given than descriptors, the remaining file descriptors will be unnamed.
-        </para></listitem>
-      </varlistentry>
-
-      <xi:include href="standard-options.xml" xpointer="help" />
-      <xi:include href="standard-options.xml" xpointer="version" />
-    </variablelist>
-  </refsect1>
-
-  <refsect1>
-    <title>Environment variables</title>
-    <variablelist class='environment-variables'>
-      <varlistentry>
-        <term><varname>$LISTEN_FDS</varname></term>
-        <term><varname>$LISTEN_PID</varname></term>
-        <term><varname>$LISTEN_FDNAMES</varname></term>
-
-        <listitem><para>See
-        <citerefentry><refentrytitle>sd_listen_fds</refentrytitle><manvolnum>3</manvolnum></citerefentry>.</para></listitem>
-      </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>
-
-        <listitem><para>Same as in
-        <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>.</para></listitem>
-      </varlistentry>
-    </variablelist>
-  </refsect1>
-
-  <refsect1>
-    <title>Examples</title>
-
-    <example>
-      <title>Run an echo server on port 2000</title>
-
-      <programlisting>$ /usr/lib/systemd/systemd-activate -l 2000 --inetd -a cat</programlisting>
-    </example>
-
-    <example>
-      <title>Run a socket-activated instance of <citerefentry><refentrytitle>systemd-journal-gatewayd</refentrytitle><manvolnum>8</manvolnum></citerefentry></title>
-
-      <programlisting>$ /usr/lib/systemd/systemd-activate -l 19531 /usr/lib/systemd/systemd-journal-gatewayd</programlisting>
-    </example>
-  </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>,
-      <citerefentry><refentrytitle>sd_listen_fds</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
-      <citerefentry><refentrytitle>sd_listen_fds_with_names</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
-      <citerefentry project='man-pages'><refentrytitle>cat</refentrytitle><manvolnum>1</manvolnum></citerefentry>
-    </para>
-  </refsect1>
-</refentry>
diff --git a/man/systemd-socket-activate.xml b/man/systemd-socket-activate.xml
new file mode 100644 (file)
index 0000000..5d7f157
--- /dev/null
@@ -0,0 +1,206 @@
+<?xml version='1.0'?> <!--*- Mode: nxml; nxml-child-indent: 2; indent-tabs-mode: nil -*-->
+<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
+"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
+
+<!--
+  This file is part of systemd.
+
+  Copyright 2013 Zbigniew Jędrzejewski-Szmek
+
+  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.
+
+  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.
+
+  You should have received a copy of the GNU Lesser General Public License
+  along with systemd; If not, see <http://www.gnu.org/licenses/>.
+-->
+
+<refentry id="systemd-socket-activate"
+          xmlns:xi="http://www.w3.org/2001/XInclude">
+
+  <refentryinfo>
+    <title>systemd-socket-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-socket-activate</refentrytitle>
+    <manvolnum>1</manvolnum>
+  </refmeta>
+
+  <refnamediv>
+    <refname>systemd-socket-activate</refname>
+    <refpurpose>Test socket activation of daemons</refpurpose>
+  </refnamediv>
+
+  <refsynopsisdiv>
+    <cmdsynopsis>
+      <command>systemd-socket-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-socket-activate</command> may be used to launch a socket-activated service binary from the command
+    line for testing purposes. It may also be used to launch individual instances of the service binary per connection.
+    </para>
+
+    <para>The daemon to launch and its options should be specified
+    after options intended for <command>systemd-socket-activate</command>.
+    </para>
+
+    <para>If the <option>--inetd</option> 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 <varname>$LISTEN_FDS</varname> to
+    <command>systemd-socket-activate</command> will be passed through to the daemon, in the original positions. Other sockets
+    specified with <option>--listen=</option> will use consecutive descriptors.  By default,
+    <command>systemd-socket-activate</command> listens on a stream socket, use <option>--datagram</option> and
+    <option>--seqpacket</option> to listen on datagram or sequential packet sockets instead (see below).
+    </para>
+  </refsect1>
+
+  <refsect1>
+    <title>Options</title>
+    <variablelist>
+      <varlistentry>
+        <term><option>-l <replaceable>address</replaceable></option></term>
+        <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 an instance of the service binary for each connection and pass the connection
+        socket.</para></listitem>
+      </varlistentry>
+
+      <varlistentry>
+        <term><option>-d</option></term>
+        <term><option>--datagram</option></term>
+
+        <listitem><para>Listen on a datagram socket (<constant>SOCK_DGRAM</constant>), instead of a stream socket
+        (<constant>SOCK_STREAM</constant>). May not be combined with <option>--seqpacket</option>.</para></listitem>
+      </varlistentry>
+
+      <varlistentry>
+        <term><option>--seqpacket</option></term>
+
+        <listitem><para>Listen on a sequential packet socket (<constant>SOCK_SEQPACKET</constant>), instead of a stream
+        socket (<constant>SOCK_STREAM</constant>). May not be combined with
+        <option>--datagram</option>.</para></listitem>
+      </varlistentry>
+
+      <varlistentry>
+        <term><option>--inetd</option></term>
+
+        <listitem><para>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 <varname>$LISTEN_FDS</varname>
+        (see above).</para></listitem>
+      </varlistentry>
+
+      <varlistentry>
+        <term><option>-E <replaceable>VAR</replaceable><optional>=<replaceable>VALUE</replaceable></optional></option></term>
+        <term><option>--setenv=<replaceable>VAR</replaceable><optional>=<replaceable>VALUE</replaceable></optional></option></term>
+
+        <listitem><para>Add this variable to the environment of the
+        launched process. If <replaceable>VAR</replaceable> is
+        followed by <literal>=</literal>, assume that it is a
+        variable–value pair. Otherwise, obtain the value from the
+        environment of <command>systemd-socket-activate</command> itself.
+        </para></listitem>
+      </varlistentry>
+
+      <varlistentry>
+        <term><option>--fdname=</option><replaceable>NAME</replaceable><optional>:<replaceable>NAME</replaceable>...</optional></term>
+
+        <listitem><para>Specify names for the file descriptors passed. This is equivalent to setting
+        <varname>FileDescriptorName=</varname> in socket unit files, and enables use of
+        <citerefentry><refentrytitle>sd_listen_fds_with_names</refentrytitle><manvolnum>3</manvolnum></citerefentry>.
+        Multiple entries may be specifies using separate options or by separating names with colons
+        (<literal>:</literal>) in one option. In case more names are given than descriptors, superflous ones willl be
+        ignored. In case less names are given than descriptors, the remaining file descriptors will be unnamed.
+        </para></listitem>
+      </varlistentry>
+
+      <xi:include href="standard-options.xml" xpointer="help" />
+      <xi:include href="standard-options.xml" xpointer="version" />
+    </variablelist>
+  </refsect1>
+
+  <refsect1>
+    <title>Environment variables</title>
+    <variablelist class='environment-variables'>
+      <varlistentry>
+        <term><varname>$LISTEN_FDS</varname></term>
+        <term><varname>$LISTEN_PID</varname></term>
+        <term><varname>$LISTEN_FDNAMES</varname></term>
+
+        <listitem><para>See
+        <citerefentry><refentrytitle>sd_listen_fds</refentrytitle><manvolnum>3</manvolnum></citerefentry>.</para></listitem>
+      </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>
+
+        <listitem><para>Same as in
+        <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>.</para></listitem>
+      </varlistentry>
+    </variablelist>
+  </refsect1>
+
+  <refsect1>
+    <title>Examples</title>
+
+    <example>
+      <title>Run an echo server on port 2000</title>
+
+      <programlisting>$ systemd-socket-activate -l 2000 --inetd -a cat</programlisting>
+    </example>
+
+    <example>
+      <title>Run a socket-activated instance of <citerefentry><refentrytitle>systemd-journal-gatewayd</refentrytitle><manvolnum>8</manvolnum></citerefentry></title>
+
+      <programlisting>$ systemd-socket-activate -l 19531 /usr/lib/systemd/systemd-journal-gatewayd</programlisting>
+    </example>
+  </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>,
+      <citerefentry><refentrytitle>sd_listen_fds</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
+      <citerefentry><refentrytitle>sd_listen_fds_with_names</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
+      <citerefentry project='man-pages'><refentrytitle>cat</refentrytitle><manvolnum>1</manvolnum></citerefentry>
+    </para>
+  </refsect1>
+</refentry>