[systemd-commits] 4 commits - Makefile.am man/shutdown.xml man/systemadm.xml man/systemd-notify.xml man/systemd.xml src/install.c src/notify.c src/systemctl.c

Lennart Poettering lennart at kemper.freedesktop.org
Wed Jun 23 20:17:09 PDT 2010


 Makefile.am            |  142 +++++++++++++++++------------------------
 man/shutdown.xml       |    2 
 man/systemadm.xml      |    2 
 man/systemd-notify.xml |  167 +++++++++++++++++++++++++++++++++++++++++++++++++
 man/systemd.xml        |    1 
 src/install.c          |    4 -
 src/notify.c           |    9 ++
 src/systemctl.c        |    2 
 8 files changed, 243 insertions(+), 86 deletions(-)

New commits:
commit c5abba08873903d80a2dcdd46aace959fcae1b0f
Author: Lennart Poettering <lennart at poettering.net>
Date:   Thu Jun 24 05:17:02 2010 +0200

    man: document systemd-notify

diff --git a/Makefile.am b/Makefile.am
index db6cf59..3a4c8f0 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -310,6 +310,7 @@ MANPAGES = \
 	man/systemctl.1 \
 	man/systemadm.1 \
 	man/systemd-install.1 \
+	man/systemd-notify.1 \
 	man/sd_notify.3 \
 	man/sd_booted.3 \
 	man/sd_listen_fds.3 \
diff --git a/man/systemd-notify.xml b/man/systemd-notify.xml
new file mode 100644
index 0000000..46f3f1a
--- /dev/null
+++ b/man/systemd-notify.xml
@@ -0,0 +1,167 @@
+<?xml version='1.0'?> <!--*-nxml-*-->
+<!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 2010 Lennart Poettering
+
+  systemd is free software; you can redistribute it and/or modify it
+  under the terms of the GNU General Public License as published by
+  the Free Software Foundation; either version 2 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
+  General Public License for more details.
+
+  You should have received a copy of the GNU General Public License
+  along with systemd; If not, see <http://www.gnu.org/licenses/>.
+-->
+
+<refentry id="systemd-notify">
+
+        <refentryinfo>
+                <title>systemd-notify</title>
+                <productname>systemd</productname>
+
+                <authorgroup>
+                        <author>
+                                <contrib>Developer</contrib>
+                                <firstname>Lennart</firstname>
+                                <surname>Poettering</surname>
+                                <email>lennart at poettering.net</email>
+                        </author>
+                </authorgroup>
+        </refentryinfo>
+
+        <refmeta>
+                <refentrytitle>systemd-notify</refentrytitle>
+                <manvolnum>1</manvolnum>
+        </refmeta>
+
+        <refnamediv>
+                <refname>systemd-notify</refname>
+                <refpurpose>Notify init system about start-up completion and other daemon status changes</refpurpose>
+        </refnamediv>
+
+        <refsynopsisdiv>
+                <cmdsynopsis>
+                        <command>systemd-notify <arg choice="opt" rep="repeat">OPTIONS</arg> <arg choice="opt" rep="repeat">VARIABLE=VALUE</arg></command>
+                </cmdsynopsis>
+        </refsynopsisdiv>
+
+        <refsect1>
+                <title>Description</title>
+
+                <para><command>systemd-notify</command> may be
+                called by daemon scripts to notify the init system
+                about status changes. It can be used to send arbitrary
+                information, encoded in an environment-block-like list
+                of strings. Most importantly it can be used for
+                start-up completion notification.</para>
+
+                <para>This is mostly just a wrapper around
+                <function>sd_notify()</function> and makes this
+                functionality available to shell scripts. For details
+                see
+                <citerefentry><refentrytitle>sd_notify</refentrytitle><manvolnum>3</manvolnum></citerefentry>.</para>
+
+                <para>The command line may carry a list of
+                environment variables to send as part of the status
+                update.</para>
+
+        </refsect1>
+
+        <refsect1>
+                <title>Options</title>
+
+                <para>The following options are understood:</para>
+
+                <variablelist>
+                        <varlistentry>
+                                <term><option>--h</option></term>
+                                <term><option>--help</option></term>
+
+                                <listitem><para>Prints a short help
+                                text and exits.</para></listitem>
+                        </varlistentry>
+
+                        <varlistentry>
+                                <term><option>--ready</option></term>
+
+                                <listitem><para>Inform the init system
+                                about service start-up
+                                completion. This is equivalent to
+                                <command>systemd-notify
+                                READY=1</command>. For details about
+                                the semantics of this option see
+                                <citerefentry><refentrytitle>sd_notify</refentrytitle><manvolnum>3</manvolnum></citerefentry>.</para></listitem>
+                        </varlistentry>
+
+                        <varlistentry>
+                                <term><option>--pid=</option></term>
+
+                                <listitem><para>Inform the init system
+                                about the main PID of the
+                                daemon. Takes a PID as argument. If
+                                the argument is omitted the PID of the
+                                process that invoked
+                                <command>systemd-notify</command> is
+                                used. This is equivalent to
+                                <command>systemd-notify
+                                MAINPID=$PID</command>. For details
+                                about the semantics of this option see
+                                <citerefentry><refentrytitle>sd_notify</refentrytitle><manvolnum>3</manvolnum></citerefentry>.</para></listitem>
+                        </varlistentry>
+
+                        <varlistentry>
+                                <term><option>--status=</option></term>
+
+                                <listitem><para>Send a free-form
+                                status string for the daemon to the
+                                init systemd. This option takes the
+                                status string as argument. This is
+                                equivalent to <command>systemd-notify
+                                STATUS=...</command>. For details
+                                about the semantics of this option see
+                                <citerefentry><refentrytitle>sd_notify</refentrytitle><manvolnum>3</manvolnum></citerefentry>.</para></listitem>
+                        </varlistentry>
+
+                        <varlistentry>
+                                <term><option>--booted</option></term>
+
+                                <listitem><para>Returns 0 if the
+                                system was booted up with systemd,
+                                non-zero otherwise. If this option is
+                                passed no message is sent. This option
+                                is hence unrelated to the other
+                                options. For details about the
+                                semantics of this option see
+                                <citerefentry><refentrytitle>sd_booted</refentrytitle><manvolnum>3</manvolnum></citerefentry>.</para></listitem>
+                        </varlistentry>
+                </variablelist>
+
+        </refsect1>
+
+        <refsect1>
+                <title>Exit status</title>
+
+                <para>On success 0 is returned, a non-zero failure
+                code otherwise.</para>
+        </refsect1>
+
+        <refsect1>
+                <title>See Also</title>
+                <para>
+                        <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
+                        <citerefentry><refentrytitle>systemctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
+                        <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
+                        <citerefentry><refentrytitle>sd_notify</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
+                        <citerefentry><refentrytitle>sd_booted</refentrytitle><manvolnum>3</manvolnum></citerefentry>
+                </para>
+        </refsect1>
+
+</refentry>
commit 2f02ce4005075ac76742ed6a2189cc2e5fc6a192
Author: Lennart Poettering <lennart at poettering.net>
Date:   Thu Jun 24 04:55:57 2010 +0200

    utils: show help blurb when run without any arguments

diff --git a/src/install.c b/src/install.c
index 0c9f086..f56c072 100644
--- a/src/install.c
+++ b/src/install.c
@@ -132,7 +132,7 @@ static int parse_argv(int argc, char *argv[]) {
         }
 
         if (optind >= argc) {
-                log_error("Missing verb.");
+                help();
                 return -EINVAL;
         }
 
@@ -143,7 +143,7 @@ static int parse_argv(int argc, char *argv[]) {
         else if (streq(argv[optind], "test"))
                 arg_action = ACTION_TEST;
         else {
-                log_error("Unknown verb %s", argv[optind]);
+                log_error("Unknown verb %s.", argv[optind]);
                 return -EINVAL;
         }
 
diff --git a/src/notify.c b/src/notify.c
index 6dd708a..514636e 100644
--- a/src/notify.c
+++ b/src/notify.c
@@ -115,6 +115,15 @@ static int parse_argv(int argc, char *argv[]) {
                 }
         }
 
+        if (optind >= argc &&
+            !arg_ready &&
+            !arg_status &&
+            !arg_pid &&
+            !arg_booted) {
+                help();
+                return -EINVAL;
+        }
+
         return 1;
 }
 
diff --git a/src/systemctl.c b/src/systemctl.c
index 9eb72f9..78310aa 100644
--- a/src/systemctl.c
+++ b/src/systemctl.c
@@ -1839,7 +1839,7 @@ static int telinit_parse_argv(int argc, char *argv[]) {
         }
 
         if (optind >= argc) {
-                log_error("Argument missing.");
+                telinit_help();
                 return -EINVAL;
         }
 
commit 6f6083dc73c4bdd48678456fa6b969d6f1152373
Author: Lennart Poettering <lennart at poettering.net>
Date:   Thu Jun 24 04:22:22 2010 +0200

    man: rework man page generation in makefile

diff --git a/Makefile.am b/Makefile.am
index 91e66fd..db6cf59 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -116,7 +116,6 @@ dist_systemunit_DATA = \
 	units/mail-transfer-agent.target \
 	units/poweroff.target \
 	units/reboot.target \
-	units/remote-fs.target \
 	units/rescue.target \
 	units/rpcbind.target \
 	units/rtc-set.target \
@@ -139,10 +138,11 @@ dist_systemunit_DATA = \
 	units/var-lock.mount \
 	units/var-run.mount
 
-systemunit_DATA = \
+nodist_systemunit_DATA = \
 	units/sysinit.target \
 	units/getty at .service \
 	units/graphical.target \
+	units/remote-fs.target \
 	units/multi-user.target \
 	units/systemd-initctl.service \
 	units/systemd-logger.service \
@@ -151,7 +151,7 @@ systemunit_DATA = \
 dist_sessionunit_DATA = \
 	units/session/default.target
 
-sessionunit_DATA = \
+nodist_sessionunit_DATA = \
 	units/session/remote-fs.target \
 	units/session/exit.service
 
@@ -304,71 +304,67 @@ EXTRA_DIST += \
 	src/sd-daemon.h \
 	src/special.h
 
-dist_man_MANS = \
-	man/systemd.unit.5 \
-	man/systemd.service.5 \
-	man/daemon.7 \
+
+MANPAGES = \
 	man/systemd.1 \
+	man/systemctl.1 \
+	man/systemadm.1 \
+	man/systemd-install.1 \
 	man/sd_notify.3 \
 	man/sd_booted.3 \
 	man/sd_listen_fds.3 \
 	man/sd_is_fifo.3 \
+	man/systemd.unit.5 \
+	man/systemd.service.5 \
+	man/daemon.7 \
 	man/sd-daemon.7 \
 	man/runlevel.8 \
 	man/telinit.8 \
 	man/halt.8 \
 	man/shutdown.8 \
-	man/systemd-install.1 \
-	man/pam_systemd.8 \
-	man/systemadm.1 \
-	man/systemctl.1
+	man/pam_systemd.8
+
+MANPAGES_ALIAS = \
+	man/reboot.8 \
+	man/poweroff.8 \
+	man/sd_is_socket.3 \
+	man/sd_is_socket_unix.3 \
+	man/sd_is_socket_inet.3 \
+	man/sd_notifyf.3 \
+	man/init.1
+
+man/reboot.8: man/halt.8
+man/poweroff.8: man/halt.8
+man/sd_is_socket.3: man/sd_is_fifo.3
+man/sd_is_socket_unix.3: man/sd_is_fifo.3
+man/sd_is_socket_inet.3: man/sd_is_fifo.3
+man/sd_notifyf.3: man/sd_notify.3
+man/init.1: man/systemd.1
+
+dist_man_MANS = \
+	$(MANPAGES) \
+	$(MANPAGES_ALIAS)
 
 nodist_man_MANS = \
 	man/systemd.special.7
 
+XML_FILES = \
+	${patsubst %.1,%.xml,${patsubst %.3,%.xml,${patsubst %.5,%.xml,${patsubst %.7,%.xml,${patsubst %.8,%.xml,$(MANPAGES)}}}}}
+
+XML_IN_FILES = \
+	${patsubst %.1,%.xml.in,${patsubst %.3,%.xml.in,${patsubst %.5,%.xml.in,${patsubst %.7,%.xml.in,${patsubst %.8,%.xml.in,$(nodist_man_MANS)}}}}}
+
 dist_noinst_DATA = \
-	man/systemd.unit.html \
-	man/systemd.service.html \
-	man/daemon.html \
-	man/systemd.html \
-	man/sd_notify.html \
-	man/sd_booted.html \
-	man/sd_listen_fds.html \
-	man/sd_is_fifo.html \
-	man/sd-daemon.html \
-	man/runlevel.html \
-	man/telinit.html \
-	man/halt.html \
-	man/shutdown.html \
-	man/systemd-install.html \
-	man/pam_systemd.html \
-	man/systemadm.html \
-	man/systemctl.html
+	${XML_FILES:.xml=.html}
 
 nodist_noinst_DATA = \
-	man/systemd.special.html
+	${XML_IN_FILES:.xml.in=.html}
 
 EXTRA_DIST += \
-	man/systemd.unit.xml \
-	man/systemd.service.xml \
-	man/systemd.special.xml.in \
-	man/systemd.special.7.in \
-	man/systemd.special.html.in \
-	man/daemon.xml \
-	man/systemd.xml \
-	man/sd_notify.xml \
-	man/sd_booted.xml \
-	man/sd_listen_fds.xml \
-	man/sd_is_fifo.xml \
-	man/sd-daemon.xml \
-	man/runlevel.xml \
-	man/telinit.xml \
-	man/halt.xml \
-	man/shutdown.xml \
-	man/systemd-install.xml \
-	man/pam_systemd.xml \
-	man/systemadm.xml \
-	man/systemctl.xml
+	$(XML_FILES) \
+	$(XML_IN_FILES) \
+	${nodist_man_MANS:=.in} \
+	${XML_IN_FILES:.xml.in=.html.in}
 
 systemd_SOURCES = \
 	src/main.c
@@ -573,24 +569,15 @@ units/session/%: units/%.m4 Makefile
 	$(M4_PROCESS_SESSION)
 
 CLEANFILES = \
-	units/systemd-initctl.service \
-	units/systemd-logger.service \
-	units/syslog.target \
-	units/sysinit.target \
-	units/getty at .service \
-	units/graphical.target \
-	units/multi-user.target \
-	units/remote-fs.target \
-	units/session/remote-fs.target \
-	units/session/exit.service \
-	man/systemd.special.7 \
-	man/systemd.special.html \
-	systemd.pc
+	$(nodist_systemunit_DATA) \
+	$(nodist_sessionunit_DATA) \
+	$(nodist_man_MANS) \
+	${XML_IN_FILES:.xml.in=.html} \
+	$(pkgconfigdata_DATA)
 
 if HAVE_VALAC
 CLEANFILES += \
-	src/systemd-interfaces.c \
-	src/systemadm.c
+	${systemadm_SOURCES:.vala=.c}
 endif
 
 if HAVE_XSLTPROC
@@ -616,16 +603,16 @@ XSLTPROC_PROCESS_HTML_IN = \
 	$(XSLTPROC) -o ${@:.in=} $(XSLTPROC_FLAGS) http://docbook.sourceforge.net/release/xsl/current/xhtml-1_1/docbook.xsl $< && \
 	mv ${@:.in=} $@
 
-man/%.3: man/%.xml
+man/%.1: man/%.xml
 	$(XSLTPROC_PROCESS_MAN)
 
-man/%.3.in: man/%.xml.in
+man/%.1.in: man/%.xml.in
 	$(XSLTPROC_PROCESS_MAN)
 
-man/%.1: man/%.xml
+man/%.3: man/%.xml
 	$(XSLTPROC_PROCESS_MAN)
 
-man/%.1.in: man/%.xml.in
+man/%.3.in: man/%.xml.in
 	$(XSLTPROC_PROCESS_MAN)
 
 man/%.5: man/%.xml
@@ -654,24 +641,16 @@ man/%.html.in: man/%.xml.in
 
 CLEANFILES += \
 	$(dist_man_MANS) \
-	man/systemd.special.7.in \
-	man/systemd.unit.html \
-	man/systemd.service.html \
-	man/systemd.special.html.in \
-	man/daemon.html \
-	man/runlevel.html \
-	man/sd_booted.html \
-	man/sd-daemon.html \
-	man/sd_is_fifo.html \
-	man/sd_listen_fds.html \
-	man/sd_notify.html \
-	man/systemd.html
+	${nodist_man_MANS:=.in} \
+	${XML_FILES:.xml=.html} \
+	${XML_IN_FILES:.xml.in=.html.in}
 endif
 
 org.freedesktop.systemd1.%.xml: systemd
 	$(AM_V_GEN)./systemd --introspect=${@:.xml=} > $@
 
-CLEANFILES += $(dbusinterface_DATA)
+CLEANFILES += \
+	$(dbusinterface_DATA)
 
 install-data-hook:
 	$(MKDIR_P) -m 0755 \
diff --git a/man/systemd.xml b/man/systemd.xml
index 36bce96..4608283 100644
--- a/man/systemd.xml
+++ b/man/systemd.xml
@@ -44,6 +44,7 @@
 
         <refnamediv>
                 <refname>systemd</refname>
+                <refname>init</refname>
                 <refpurpose>systemd System and Session Manager</refpurpose>
         </refnamediv>
 
commit 0079e4d9dc44990f363aa1aabf7c8bf5a6e6056d
Author: Lennart Poettering <lennart at poettering.net>
Date:   Thu Jun 24 03:47:03 2010 +0200

    man: minor fixes

diff --git a/man/shutdown.xml b/man/shutdown.xml
index ab14e3d..f2274a8 100644
--- a/man/shutdown.xml
+++ b/man/shutdown.xml
@@ -112,7 +112,7 @@
                         </varlistentry>
 
                         <varlistentry>
-                                <term><option>--k</option></term>
+                                <term><option>-k</option></term>
 
                                 <listitem><para>Don't halt, power-off,
                                 reboot, just write wall
diff --git a/man/systemadm.xml b/man/systemadm.xml
index 1c92a17..1377b18 100644
--- a/man/systemadm.xml
+++ b/man/systemadm.xml
@@ -96,7 +96,7 @@
 
                 </variablelist>
 
-                <para>In addition to this a number of of parameters
+                <para>In addition to this a number of parameters
                 common to all Gtk+ programs are supported.</para>
         </refsect1>
 


More information about the systemd-commits mailing list