[systemd-commits] 5 commits - Makefile.am TODO man/.gitignore man/sd_session_is_active.xml man/systemctl.xml man/systemd.special.xml man/systemd.special.xml.in src/machine-id-setup.c src/systemctl.c units/emergency.service units/rescue.service.m4
Lennart Poettering
lennart at kemper.freedesktop.org
Thu Feb 16 02:52:23 PST 2012
Makefile.am | 52 ---
TODO | 2
man/.gitignore | 2
man/sd_session_is_active.xml | 49 ++
man/systemctl.xml | 73 ++--
man/systemd.special.xml | 725 +++++++++++++++++++++++++++++++++++++++++++
man/systemd.special.xml.in | 725 -------------------------------------------
src/machine-id-setup.c | 41 ++
src/systemctl.c | 70 ++--
units/emergency.service | 2
units/rescue.service.m4 | 2
11 files changed, 916 insertions(+), 827 deletions(-)
New commits:
commit 96b0cb1181afba513e547a9233b7acd4ff622a94
Author: Lennart Poettering <lennart at poettering.net>
Date: Wed Feb 15 20:23:25 2012 +0100
man: systemd.special no longer needs sed logic
diff --git a/Makefile.am b/Makefile.am
index bad55aa..ab5000b 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -710,20 +710,11 @@ nodist_man_MANS = \
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 = \
${XML_FILES:.xml=.html}
-nodist_noinst_DATA = \
- ${XML_IN_FILES:.xml.in=.html}
-
EXTRA_DIST += \
- $(XML_FILES) \
- $(XML_IN_FILES) \
- ${nodist_man_MANS:=.in} \
- ${XML_IN_FILES:.xml.in=.html.in}
+ $(XML_FILES)
endif
systemd_SOURCES = \
@@ -2186,7 +2177,6 @@ CLEANFILES += \
$(nodist_systemunit_DATA) \
$(nodist_userunit_DATA) \
$(nodist_man_MANS) \
- ${XML_IN_FILES:.xml.in=.html} \
$(pkgconfigdata_DATA) \
$(pkgconfiglib_DATA) \
$(nodist_polkitpolicy_DATA) \
@@ -2209,61 +2199,31 @@ XSLTPROC_PROCESS_MAN = \
$(AM_V_GEN)$(MKDIR_P) $(dir $@) && \
$(XSLTPROC) -o $@ $(XSLTPROC_FLAGS) http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $<
-XSLTPROC_PROCESS_MAN_IN = \
- $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \
- $(XSLTPROC) -o ${@:.in=} $(XSLTPROC_FLAGS) http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $< && \
- mv ${@:.in=} $@
-
XSLTPROC_PROCESS_HTML = \
$(AM_V_GEN)$(MKDIR_P) $(dir $@) && \
$(XSLTPROC) -o $@ $(XSLTPROC_FLAGS) $(srcdir)/man/custom-html.xsl $<
-XSLTPROC_PROCESS_HTML_IN = \
- $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \
- $(XSLTPROC) -o ${@:.in=} $(XSLTPROC_FLAGS) $(srcdir)/man/custom-html.xsl $< && \
- mv ${@:.in=} $@
-
man/%.1: man/%.xml
$(XSLTPROC_PROCESS_MAN)
-man/%.1.in: man/%.xml.in
- $(XSLTPROC_PROCESS_MAN)
-
man/%.3: man/%.xml
$(XSLTPROC_PROCESS_MAN)
-man/%.3.in: man/%.xml.in
- $(XSLTPROC_PROCESS_MAN)
-
man/%.5: man/%.xml
$(XSLTPROC_PROCESS_MAN)
-man/%.5.in: man/%.xml.in
- $(XSLTPROC_PROCESS_MAN)
-
man/%.7: man/%.xml
$(XSLTPROC_PROCESS_MAN)
-man/%.7.in: man/%.xml.in
- $(XSLTPROC_PROCESS_MAN_IN)
-
man/%.8: man/%.xml
$(XSLTPROC_PROCESS_MAN)
-man/%.8.in: man/%.xml.in
- $(XSLTPROC_PROCESS_MAN_IN)
-
man/%.html: man/%.xml
$(XSLTPROC_PROCESS_HTML)
-man/%.html.in: man/%.xml.in
- $(XSLTPROC_PROCESS_HTML_IN)
-
CLEANFILES += \
$(dist_man_MANS) \
- ${nodist_man_MANS:=.in} \
- ${XML_FILES:.xml=.html} \
- ${XML_IN_FILES:.xml.in=.html.in}
+ ${XML_FILES:.xml=.html}
endif
DBUS_PREPROCESS = $(CPP) -P $(DBUS_CFLAGS) -imacros dbus/dbus-protocol.h
diff --git a/man/.gitignore b/man/.gitignore
deleted file mode 100644
index b127cf1..0000000
--- a/man/.gitignore
+++ /dev/null
@@ -1,2 +0,0 @@
-systemd.special.7.in
-systemd.special.html.in
diff --git a/man/systemd.special.xml b/man/systemd.special.xml
new file mode 100644
index 0000000..116a43c
--- /dev/null
+++ b/man/systemd.special.xml
@@ -0,0 +1,725 @@
+<?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.special">
+
+ <refentryinfo>
+ <title>systemd.special</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.special</refentrytitle>
+ <manvolnum>7</manvolnum>
+ </refmeta>
+
+ <refnamediv>
+ <refname>systemd.special</refname>
+ <refpurpose>special systemd units</refpurpose>
+ </refnamediv>
+
+ <refsynopsisdiv>
+ <para><filename>basic.target</filename>,
+ <filename>ctrl-alt-del.target</filename>,
+ <filename>dbus.service</filename>,
+ <filename>default.target</filename>,
+ <filename>display-manager.service</filename>,
+ <filename>emergency.target</filename>,
+ <filename>exit.service</filename>,
+ <filename>graphical.target</filename>,
+ <filename>halt.target</filename>,
+ <filename>kbrequest.target</filename>,
+ <filename>local-fs.target</filename>,
+ <filename>local-fs-pre.target</filename>,
+ <filename>mail-transfer-agent.target</filename>,
+ <filename>multi-user.target</filename>,
+ <filename>network.target</filename>,
+ <filename>nss-lookup.target</filename>,
+ <filename>poweroff.target</filename>,
+ <filename>reboot.target</filename>,
+ <filename>remote-fs.target</filename>,
+ <filename>remote-fs-pre.target</filename>,
+ <filename>rescue.target</filename>,
+ <filename>rpcbind.target</filename>,
+ <filename>runlevel2.target</filename>,
+ <filename>runlevel3.target</filename>,
+ <filename>runlevel4.target</filename>,
+ <filename>runlevel5.target</filename>,
+ <filename>shutdown.target</filename>,
+ <filename>sigpwr.target</filename>,
+ <filename>sockets.target</filename>,
+ <filename>swap.target</filename>,
+ <filename>sysinit.target</filename>,
+ <filename>syslog.target</filename>,
+ <filename>systemd-initctl.service</filename>,
+ <filename>systemd-initctl.socket</filename>,
+ <filename>systemd-stdout-syslog-bridge.service</filename>,
+ <filename>systemd-stdout-syslog-bridge.socket</filename>,
+ <filename>time-sync.target</filename>,
+ <filename>umount.target</filename></para>
+ </refsynopsisdiv>
+
+ <refsect1>
+ <title>Description</title>
+
+ <para>A few units are treated specially by
+ systemd. They have special internal semantics and
+ cannot be renamed.</para>
+ </refsect1>
+
+ <refsect1>
+ <title>Special System Units</title>
+
+ <variablelist>
+ <varlistentry>
+ <term><filename>basic.target</filename></term>
+ <listitem>
+ <para>A special target unit
+ covering early boot-up.</para>
+ <para>systemd automatically
+ adds dependencies of the types
+ Requires and After for this
+ target unit to all SysV
+ service units configured for
+ runlevel 1 to 5.</para>
+ <para>Usually this should pull-in
+ all sockets, mount points,
+ swap devices and other basic
+ initialization necessary for
+ the general purpose
+ daemons. Most normal daemons
+ should have dependencies of
+ type After and Requires on
+ this unit.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><filename>ctrl-alt-del.target</filename></term>
+ <listitem>
+ <para>systemd starts this
+ target whenever
+ Control+Alt+Del is pressed on
+ the console. Usually this
+ should be aliased (symlinked)
+ to
+ <filename>reboot.target</filename>.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><filename>dbus.service</filename></term>
+ <listitem>
+ <para>A special unit for the
+ D-Bus system bus. As soon as
+ this service is fully started
+ up systemd will connect to it
+ and register its
+ service.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><filename>default.target</filename></term>
+ <listitem>
+ <para>The default unit systemd
+ starts at bootup. Usually this
+ should be aliased (symlinked)
+ to
+ <filename>multi-user.target</filename>
+ or
+ <filename>graphical.target</filename>.</para>
+ <para>The default unit systemd
+ starts at bootup can be
+ overridden with the
+ <varname>systemd.unit=</varname>
+ kernel command line option.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><filename>display-manager.service</filename></term>
+ <listitem>
+ <para>The display manager
+ service. Usually this should
+ be aliased (symlinked) to
+ <filename>xdm.service</filename>
+ or a similar display manager
+ service.</para>
+ <para>systemd automatically
+ adds dependencies of type
+ After for this target unit to
+ all SysV init script service
+ units with a LSB header
+ referring to the
+ <literal>$x-display-manager</literal>
+ facility, for compatibility
+ with Debian.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><filename>emergency.target</filename></term>
+ <listitem>
+ <para>A special target unit
+ that starts an emergency
+ shell on the main
+ console. This unit is supposed
+ to be used with the kernel
+ command line option
+ <varname>systemd.unit=</varname>
+ and has otherwise little use.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><filename>graphical.target</filename></term>
+ <listitem>
+ <para>A special target unit
+ for setting up a graphical
+ login screen. This pulls in
+ <filename>multi-user.target</filename>.</para>
+
+ <para>Units that are needed
+ for graphical login shall add
+ Wants dependencies for their
+ unit to this unit (or
+ <filename>multi-user.target</filename>)
+ during installation.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><filename>halt.target</filename></term>
+ <listitem>
+ <para>A special target unit
+ for shutting down and halting the system.</para>
+
+ <para>Applications wanting to
+ halt the system should start
+ this unit.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><filename>kbrequest.target</filename></term>
+ <listitem>
+ <para>systemd starts this
+ target whenever Alt+ArrowUp is
+ pressed on the console. This
+ is a good candidate to be
+ aliased (symlinked) to
+ <filename>rescue.target</filename>.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><filename>local-fs.target</filename></term>
+ <listitem>
+ <para>systemd automatically
+ adds dependencies of type
+ After to all mount units that
+ refer to local mount points
+ for this target unit. In
+ addition, systemd adds
+ dependencies of type Wants to
+ this target unit for those
+ mounts listed in
+ <filename>/etc/fstab</filename>
+ that have the
+ <option>auto</option> and
+ <option>comment=systemd.mount</option>
+ mount options set.</para>
+
+ <para>systemd automatically
+ adds dependencies of type
+ After for this target unit to
+ all SysV init script service
+ units with an LSB header
+ referring to the
+ <literal>$local_fs</literal>
+ facility.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><filename>local-fs-pre.target</filename></term>
+ <listitem>
+ <para>This target unit is
+ automatically ordered before
+ all local mount points marked
+ with <option>auto</option>
+ (see above). It can be used to
+ execute certain units before
+ all local mounts.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><filename>mail-transfer-agent.target</filename></term>
+ <listitem>
+ <para>The mail transfer agent
+ (MTA) service. Usually this
+ should pull-in all units
+ necessary for
+ sending/receiving mails on the
+ local host.</para>
+
+ <para>systemd automatically
+ adds dependencies of type
+ After for this target unit to
+ all SysV init script service
+ units with an LSB header
+ referring to the
+ <literal>$mail-transfer-agent</literal>
+ or
+ <literal>$mail-transport-agent</literal>
+ facilities, for compatibility
+ with Debian.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><filename>multi-user.target</filename></term>
+ <listitem>
+ <para>A special target unit
+ for setting up a multi-user
+ system (non-graphical). This
+ is pulled in by
+ <filename>graphical.target</filename>.</para>
+
+ <para>Units that are needed
+ for a multi-user system shall
+ add Wants dependencies to
+ this unit for their unit during
+ installation.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><filename>network.target</filename></term>
+ <listitem>
+ <para>systemd automatically
+ adds dependencies of type
+ After for this target unit to
+ all SysV init script service
+ units with an LSB header
+ referring to the
+ <literal>$network</literal>
+ facility.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><filename>nss-lookup.target</filename></term>
+ <listitem>
+ <para>systemd automatically
+ adds dependencies of type
+ After for this target unit to
+ all SysV init script service
+ units with an LSB header
+ referring to the
+ <literal>$named</literal>
+ facility.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><filename>poweroff.target</filename></term>
+ <listitem>
+ <para>A special target unit
+ for shutting down and powering off the system.</para>
+
+ <para>Applications wanting to
+ power off the system should start
+ this unit.</para>
+
+ <para><filename>runlevel0.target</filename>
+ is an alias for this target
+ unit, for compatibility with SysV.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><filename>reboot.target</filename></term>
+ <listitem>
+ <para>A special target unit
+ for shutting down and rebooting the system.</para>
+
+ <para>Applications wanting to
+ reboot the system should start
+ this unit.</para>
+
+ <para><filename>runlevel6.target</filename>
+ is an alias for this target
+ unit, for compatibility with SysV.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><filename>remote-fs.target</filename></term>
+ <listitem>
+ <para>Similar to
+ <filename>local-fs.target</filename>,
+ but for remote mount
+ points.</para>
+
+ <para>systemd automatically
+ adds dependencies of type
+ After for this target unit to
+ all SysV init script service
+ units with an LSB header
+ referring to the
+ <literal>$remote_fs</literal>
+ facility.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><filename>remote-fs-pre.target</filename></term>
+ <listitem>
+ <para>This target unit is
+ automatically ordered before
+ all remote mount points marked
+ with <option>auto</option>
+ (see above). It can be used to
+ execute certain units before
+ all remote mounts.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><filename>rescue.target</filename></term>
+ <listitem>
+ <para>A special target unit
+ for setting up the base system
+ and a rescue shell.</para>
+
+ <para><filename>runlevel1.target</filename>
+ is an alias for this target
+ unit, for compatibility with SysV.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><filename>rpcbind.target</filename></term>
+ <listitem>
+ <para>systemd automatically
+ adds dependencies of type
+ After for this target unit to
+ all SysV init script service
+ units with an LSB header
+ referring to the
+ <literal>$rpcbind</literal>
+ facility.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><filename>runlevel2.target</filename></term>
+ <listitem>
+ <para>This is a target that is
+ called whenever the SysV
+ compatibility code asks for
+ runlevel 2. It is a good idea
+ to make this an alias for
+ (i.e. symlink to)
+ <filename>multi-user.target</filename>.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><filename>runlevel3.target</filename></term>
+ <listitem>
+ <para>This is a target that is
+ called whenever the SysV
+ compatibility code asks for
+ runlevel 3. It is a good idea
+ to make this an alias for
+ (i.e. symlink to)
+ <filename>multi-user.target</filename>
+ or
+ <filename>graphical.target</filename>.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><filename>runlevel4.target</filename></term>
+ <listitem>
+ <para>This is a target that is
+ called whenever the SysV
+ compatibility code asks for
+ runlevel 4. It is a good idea
+ to make this an alias for
+ (i.e. symlink to)
+ <filename>multi-user.target</filename>
+ or
+ <filename>graphical.target</filename>.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><filename>runlevel5.target</filename></term>
+ <listitem>
+ <para>This is a target that is
+ called whenever the SysV
+ compatibility code asks for
+ runlevel 5. It is a good idea
+ to make this an alias for
+ (i.e. symlink to)
+ <filename>multi-user.target</filename>
+ or
+ <filename>graphical.target</filename>.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><filename>shutdown.target</filename></term>
+ <listitem>
+ <para>A special target unit
+ that terminates the services
+ on system shutdown.</para>
+
+ <para>Services that shall be
+ terminated on system shutdown
+ shall add Conflicts
+ dependencies to this unit for
+ their service unit, which is
+ implicitly done when
+ <varname>DefaultDependencies=yes</varname>
+ is set (the default).</para>
+
+ <para>systemd automatically
+ adds dependencies of type
+ Conflicts to this target unit
+ for all SysV init script
+ service units that shall be
+ terminated in SysV runlevels 0
+ or 6.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><filename>sigpwr.target</filename></term>
+ <listitem>
+ <para>A special target that is
+ started when systemd receives
+ the SIGPWR process signal,
+ which is normally sent by the
+ kernel or UPS daemons when
+ power fails.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><filename>sockets.target</filename></term>
+ <listitem>
+ <para>A special target unit
+ that sets up all service
+ sockets.</para>
+
+ <para>Services that can be
+ socket-activated shall add
+ Wants dependencies to this
+ unit for their socket unit
+ during installation.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><filename>swap.target</filename></term>
+ <listitem>
+ <para>Similar to
+ <filename>local-fs.target</filename>, but for swap
+ partitions and swap
+ files.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><filename>sysinit.target</filename></term>
+ <listitem>
+ <para>A special target unit
+ covering early boot-up scripts.</para>
+ <para>systemd automatically
+ adds dependencies of the types
+ Wants and After for all
+ SysV service units configured
+ for runlevels that are not 0
+ to 6 to this target unit.
+ This covers the special
+ boot-up runlevels some
+ distributions have, such as S
+ or b.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><filename>syslog.target</filename></term>
+ <listitem>
+ <para>systemd automatically
+ adds dependencies of type
+ After for this target unit to
+ all SysV init script service
+ units with an LSB header
+ referring to the
+ <literal>$syslog</literal>
+ facility.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><filename>systemd-initctl.service</filename></term>
+ <listitem>
+ <para>This provides
+ compatibility with the SysV
+ /dev/initctl file system FIFO
+ for communication with the
+ init system.</para>
+ <para>This is a
+ socket-activated service, see
+ <filename>system-initctl.socket</filename>.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><filename>systemd-initctl.socket</filename></term>
+ <listitem>
+ <para>Socket activation unit
+ for
+ <filename>system-initctl.service</filename>.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><filename>systemd-stdout-syslog-bridge.service</filename></term>
+ <listitem>
+ <para>This is internally used
+ by systemd to provide syslog
+ logging to the processes it
+ maintains.</para>
+ <para>This is a
+ socket-activated service, see
+ <filename>system-stdout-syslog-bridge.socket</filename>.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><filename>systemd-stdout-syslog-bridge.socket</filename></term>
+ <listitem>
+ <para>Socket activation unit
+ for
+ <filename>system-stdout-syslog-bridge.service</filename>. systemd
+ will automatically add
+ dependencies of types Requires
+ and After to all units that
+ have been configured for
+ stdout or stderr to be
+ connected to syslog or the
+ kernel log buffer.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><filename>systemd-shutdownd.service</filename></term>
+ <listitem>
+ <para>This is internally used
+ by
+ <citerefentry><refentrytitle>shutdown</refentrytitle><manvolnum>8</manvolnum></citerefentry>
+ to implement delayed shutdowns.</para>
+ <para>This is a
+ socket-activated service, see
+ <filename>system-shutdownd.socket</filename>.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><filename>systemd-shutdownd.socket</filename></term>
+ <listitem>
+ <para>Socket activation unit
+ for
+ <filename>system-shutdownd.service</filename>.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><filename>time-sync.target</filename></term>
+ <listitem>
+ <para>systemd automatically
+ adds dependencies of type
+ After for this target unit to
+ all SysV init script service
+ units with an LSB header
+ referring to the
+ <literal>$time</literal>
+ facility.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><filename>umount.target</filename></term>
+ <listitem>
+ <para>A special target unit
+ that umounts all mount and
+ automount points on system
+ shutdown.</para>
+
+ <para>Mounts that shall be
+ unmounted on system shutdown
+ shall add Conflicts
+ dependencies to this unit for
+ their mount unit, which is
+ implicitly done when
+ <varname>DefaultDependencies=yes</varname>
+ is set (the default).</para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsect1>
+
+ <refsect1>
+ <title>Special User Units</title>
+
+ <para>When systemd runs as a user instance, the
+ following special units are available, which have
+ similar definitions as their system counterparts:
+ <filename>default.target</filename>,
+ <filename>local-fs.target</filename>,
+ <filename>remote-fs.target</filename>,
+ <filename>shutdown.target</filename>,
+ <filename>sockets.target</filename>,
+ <filename>swap.target</filename>.</para>
+
+ <para>In addition the following special unit is
+ understood only when systemd runs as service instance:</para>
+
+ <variablelist>
+ <varlistentry>
+ <term><filename>exit.service</filename></term>
+ <listitem>
+ <para>A special service unit
+ for shutting down the
+ user service manager.</para>
+
+ <para>Applications wanting to
+ terminate the user service
+ manager should start this
+ unit. If systemd receives
+ SIGTERM or SIGINT when running
+ as user service daemon it will
+ start this unit.</para>
+
+ <para>Normally, this pulls in
+ <filename>shutdown.target</filename>
+ which in turn should be
+ conflicted by all units that
+ want to be shut down on
+ user service manager exit.</para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsect1>
+
+ <refsect1>
+ <title>See Also</title>
+ <para>
+ <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
+ <citerefentry><refentrytitle>systemd.service</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
+ <citerefentry><refentrytitle>systemd.socket</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
+ <citerefentry><refentrytitle>systemd.target</refentrytitle><manvolnum>5</manvolnum></citerefentry>
+ </para>
+ </refsect1>
+
+</refentry>
diff --git a/man/systemd.special.xml.in b/man/systemd.special.xml.in
deleted file mode 100644
index 116a43c..0000000
--- a/man/systemd.special.xml.in
+++ /dev/null
@@ -1,725 +0,0 @@
-<?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.special">
-
- <refentryinfo>
- <title>systemd.special</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.special</refentrytitle>
- <manvolnum>7</manvolnum>
- </refmeta>
-
- <refnamediv>
- <refname>systemd.special</refname>
- <refpurpose>special systemd units</refpurpose>
- </refnamediv>
-
- <refsynopsisdiv>
- <para><filename>basic.target</filename>,
- <filename>ctrl-alt-del.target</filename>,
- <filename>dbus.service</filename>,
- <filename>default.target</filename>,
- <filename>display-manager.service</filename>,
- <filename>emergency.target</filename>,
- <filename>exit.service</filename>,
- <filename>graphical.target</filename>,
- <filename>halt.target</filename>,
- <filename>kbrequest.target</filename>,
- <filename>local-fs.target</filename>,
- <filename>local-fs-pre.target</filename>,
- <filename>mail-transfer-agent.target</filename>,
- <filename>multi-user.target</filename>,
- <filename>network.target</filename>,
- <filename>nss-lookup.target</filename>,
- <filename>poweroff.target</filename>,
- <filename>reboot.target</filename>,
- <filename>remote-fs.target</filename>,
- <filename>remote-fs-pre.target</filename>,
- <filename>rescue.target</filename>,
- <filename>rpcbind.target</filename>,
- <filename>runlevel2.target</filename>,
- <filename>runlevel3.target</filename>,
- <filename>runlevel4.target</filename>,
- <filename>runlevel5.target</filename>,
- <filename>shutdown.target</filename>,
- <filename>sigpwr.target</filename>,
- <filename>sockets.target</filename>,
- <filename>swap.target</filename>,
- <filename>sysinit.target</filename>,
- <filename>syslog.target</filename>,
- <filename>systemd-initctl.service</filename>,
- <filename>systemd-initctl.socket</filename>,
- <filename>systemd-stdout-syslog-bridge.service</filename>,
- <filename>systemd-stdout-syslog-bridge.socket</filename>,
- <filename>time-sync.target</filename>,
- <filename>umount.target</filename></para>
- </refsynopsisdiv>
-
- <refsect1>
- <title>Description</title>
-
- <para>A few units are treated specially by
- systemd. They have special internal semantics and
- cannot be renamed.</para>
- </refsect1>
-
- <refsect1>
- <title>Special System Units</title>
-
- <variablelist>
- <varlistentry>
- <term><filename>basic.target</filename></term>
- <listitem>
- <para>A special target unit
- covering early boot-up.</para>
- <para>systemd automatically
- adds dependencies of the types
- Requires and After for this
- target unit to all SysV
- service units configured for
- runlevel 1 to 5.</para>
- <para>Usually this should pull-in
- all sockets, mount points,
- swap devices and other basic
- initialization necessary for
- the general purpose
- daemons. Most normal daemons
- should have dependencies of
- type After and Requires on
- this unit.</para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><filename>ctrl-alt-del.target</filename></term>
- <listitem>
- <para>systemd starts this
- target whenever
- Control+Alt+Del is pressed on
- the console. Usually this
- should be aliased (symlinked)
- to
- <filename>reboot.target</filename>.</para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><filename>dbus.service</filename></term>
- <listitem>
- <para>A special unit for the
- D-Bus system bus. As soon as
- this service is fully started
- up systemd will connect to it
- and register its
- service.</para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><filename>default.target</filename></term>
- <listitem>
- <para>The default unit systemd
- starts at bootup. Usually this
- should be aliased (symlinked)
- to
- <filename>multi-user.target</filename>
- or
- <filename>graphical.target</filename>.</para>
- <para>The default unit systemd
- starts at bootup can be
- overridden with the
- <varname>systemd.unit=</varname>
- kernel command line option.</para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><filename>display-manager.service</filename></term>
- <listitem>
- <para>The display manager
- service. Usually this should
- be aliased (symlinked) to
- <filename>xdm.service</filename>
- or a similar display manager
- service.</para>
- <para>systemd automatically
- adds dependencies of type
- After for this target unit to
- all SysV init script service
- units with a LSB header
- referring to the
- <literal>$x-display-manager</literal>
- facility, for compatibility
- with Debian.</para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><filename>emergency.target</filename></term>
- <listitem>
- <para>A special target unit
- that starts an emergency
- shell on the main
- console. This unit is supposed
- to be used with the kernel
- command line option
- <varname>systemd.unit=</varname>
- and has otherwise little use.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><filename>graphical.target</filename></term>
- <listitem>
- <para>A special target unit
- for setting up a graphical
- login screen. This pulls in
- <filename>multi-user.target</filename>.</para>
-
- <para>Units that are needed
- for graphical login shall add
- Wants dependencies for their
- unit to this unit (or
- <filename>multi-user.target</filename>)
- during installation.</para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><filename>halt.target</filename></term>
- <listitem>
- <para>A special target unit
- for shutting down and halting the system.</para>
-
- <para>Applications wanting to
- halt the system should start
- this unit.</para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><filename>kbrequest.target</filename></term>
- <listitem>
- <para>systemd starts this
- target whenever Alt+ArrowUp is
- pressed on the console. This
- is a good candidate to be
- aliased (symlinked) to
- <filename>rescue.target</filename>.</para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><filename>local-fs.target</filename></term>
- <listitem>
- <para>systemd automatically
- adds dependencies of type
- After to all mount units that
- refer to local mount points
- for this target unit. In
- addition, systemd adds
- dependencies of type Wants to
- this target unit for those
- mounts listed in
- <filename>/etc/fstab</filename>
- that have the
- <option>auto</option> and
- <option>comment=systemd.mount</option>
- mount options set.</para>
-
- <para>systemd automatically
- adds dependencies of type
- After for this target unit to
- all SysV init script service
- units with an LSB header
- referring to the
- <literal>$local_fs</literal>
- facility.</para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><filename>local-fs-pre.target</filename></term>
- <listitem>
- <para>This target unit is
- automatically ordered before
- all local mount points marked
- with <option>auto</option>
- (see above). It can be used to
- execute certain units before
- all local mounts.</para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><filename>mail-transfer-agent.target</filename></term>
- <listitem>
- <para>The mail transfer agent
- (MTA) service. Usually this
- should pull-in all units
- necessary for
- sending/receiving mails on the
- local host.</para>
-
- <para>systemd automatically
- adds dependencies of type
- After for this target unit to
- all SysV init script service
- units with an LSB header
- referring to the
- <literal>$mail-transfer-agent</literal>
- or
- <literal>$mail-transport-agent</literal>
- facilities, for compatibility
- with Debian.</para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><filename>multi-user.target</filename></term>
- <listitem>
- <para>A special target unit
- for setting up a multi-user
- system (non-graphical). This
- is pulled in by
- <filename>graphical.target</filename>.</para>
-
- <para>Units that are needed
- for a multi-user system shall
- add Wants dependencies to
- this unit for their unit during
- installation.</para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><filename>network.target</filename></term>
- <listitem>
- <para>systemd automatically
- adds dependencies of type
- After for this target unit to
- all SysV init script service
- units with an LSB header
- referring to the
- <literal>$network</literal>
- facility.</para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><filename>nss-lookup.target</filename></term>
- <listitem>
- <para>systemd automatically
- adds dependencies of type
- After for this target unit to
- all SysV init script service
- units with an LSB header
- referring to the
- <literal>$named</literal>
- facility.</para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><filename>poweroff.target</filename></term>
- <listitem>
- <para>A special target unit
- for shutting down and powering off the system.</para>
-
- <para>Applications wanting to
- power off the system should start
- this unit.</para>
-
- <para><filename>runlevel0.target</filename>
- is an alias for this target
- unit, for compatibility with SysV.</para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><filename>reboot.target</filename></term>
- <listitem>
- <para>A special target unit
- for shutting down and rebooting the system.</para>
-
- <para>Applications wanting to
- reboot the system should start
- this unit.</para>
-
- <para><filename>runlevel6.target</filename>
- is an alias for this target
- unit, for compatibility with SysV.</para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><filename>remote-fs.target</filename></term>
- <listitem>
- <para>Similar to
- <filename>local-fs.target</filename>,
- but for remote mount
- points.</para>
-
- <para>systemd automatically
- adds dependencies of type
- After for this target unit to
- all SysV init script service
- units with an LSB header
- referring to the
- <literal>$remote_fs</literal>
- facility.</para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><filename>remote-fs-pre.target</filename></term>
- <listitem>
- <para>This target unit is
- automatically ordered before
- all remote mount points marked
- with <option>auto</option>
- (see above). It can be used to
- execute certain units before
- all remote mounts.</para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><filename>rescue.target</filename></term>
- <listitem>
- <para>A special target unit
- for setting up the base system
- and a rescue shell.</para>
-
- <para><filename>runlevel1.target</filename>
- is an alias for this target
- unit, for compatibility with SysV.</para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><filename>rpcbind.target</filename></term>
- <listitem>
- <para>systemd automatically
- adds dependencies of type
- After for this target unit to
- all SysV init script service
- units with an LSB header
- referring to the
- <literal>$rpcbind</literal>
- facility.</para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><filename>runlevel2.target</filename></term>
- <listitem>
- <para>This is a target that is
- called whenever the SysV
- compatibility code asks for
- runlevel 2. It is a good idea
- to make this an alias for
- (i.e. symlink to)
- <filename>multi-user.target</filename>.</para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><filename>runlevel3.target</filename></term>
- <listitem>
- <para>This is a target that is
- called whenever the SysV
- compatibility code asks for
- runlevel 3. It is a good idea
- to make this an alias for
- (i.e. symlink to)
- <filename>multi-user.target</filename>
- or
- <filename>graphical.target</filename>.</para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><filename>runlevel4.target</filename></term>
- <listitem>
- <para>This is a target that is
- called whenever the SysV
- compatibility code asks for
- runlevel 4. It is a good idea
- to make this an alias for
- (i.e. symlink to)
- <filename>multi-user.target</filename>
- or
- <filename>graphical.target</filename>.</para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><filename>runlevel5.target</filename></term>
- <listitem>
- <para>This is a target that is
- called whenever the SysV
- compatibility code asks for
- runlevel 5. It is a good idea
- to make this an alias for
- (i.e. symlink to)
- <filename>multi-user.target</filename>
- or
- <filename>graphical.target</filename>.</para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><filename>shutdown.target</filename></term>
- <listitem>
- <para>A special target unit
- that terminates the services
- on system shutdown.</para>
-
- <para>Services that shall be
- terminated on system shutdown
- shall add Conflicts
- dependencies to this unit for
- their service unit, which is
- implicitly done when
- <varname>DefaultDependencies=yes</varname>
- is set (the default).</para>
-
- <para>systemd automatically
- adds dependencies of type
- Conflicts to this target unit
- for all SysV init script
- service units that shall be
- terminated in SysV runlevels 0
- or 6.</para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><filename>sigpwr.target</filename></term>
- <listitem>
- <para>A special target that is
- started when systemd receives
- the SIGPWR process signal,
- which is normally sent by the
- kernel or UPS daemons when
- power fails.</para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><filename>sockets.target</filename></term>
- <listitem>
- <para>A special target unit
- that sets up all service
- sockets.</para>
-
- <para>Services that can be
- socket-activated shall add
- Wants dependencies to this
- unit for their socket unit
- during installation.</para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><filename>swap.target</filename></term>
- <listitem>
- <para>Similar to
- <filename>local-fs.target</filename>, but for swap
- partitions and swap
- files.</para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><filename>sysinit.target</filename></term>
- <listitem>
- <para>A special target unit
- covering early boot-up scripts.</para>
- <para>systemd automatically
- adds dependencies of the types
- Wants and After for all
- SysV service units configured
- for runlevels that are not 0
- to 6 to this target unit.
- This covers the special
- boot-up runlevels some
- distributions have, such as S
- or b.</para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><filename>syslog.target</filename></term>
- <listitem>
- <para>systemd automatically
- adds dependencies of type
- After for this target unit to
- all SysV init script service
- units with an LSB header
- referring to the
- <literal>$syslog</literal>
- facility.</para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><filename>systemd-initctl.service</filename></term>
- <listitem>
- <para>This provides
- compatibility with the SysV
- /dev/initctl file system FIFO
- for communication with the
- init system.</para>
- <para>This is a
- socket-activated service, see
- <filename>system-initctl.socket</filename>.</para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><filename>systemd-initctl.socket</filename></term>
- <listitem>
- <para>Socket activation unit
- for
- <filename>system-initctl.service</filename>.</para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><filename>systemd-stdout-syslog-bridge.service</filename></term>
- <listitem>
- <para>This is internally used
- by systemd to provide syslog
- logging to the processes it
- maintains.</para>
- <para>This is a
- socket-activated service, see
- <filename>system-stdout-syslog-bridge.socket</filename>.</para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><filename>systemd-stdout-syslog-bridge.socket</filename></term>
- <listitem>
- <para>Socket activation unit
- for
- <filename>system-stdout-syslog-bridge.service</filename>. systemd
- will automatically add
- dependencies of types Requires
- and After to all units that
- have been configured for
- stdout or stderr to be
- connected to syslog or the
- kernel log buffer.</para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><filename>systemd-shutdownd.service</filename></term>
- <listitem>
- <para>This is internally used
- by
- <citerefentry><refentrytitle>shutdown</refentrytitle><manvolnum>8</manvolnum></citerefentry>
- to implement delayed shutdowns.</para>
- <para>This is a
- socket-activated service, see
- <filename>system-shutdownd.socket</filename>.</para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><filename>systemd-shutdownd.socket</filename></term>
- <listitem>
- <para>Socket activation unit
- for
- <filename>system-shutdownd.service</filename>.</para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><filename>time-sync.target</filename></term>
- <listitem>
- <para>systemd automatically
- adds dependencies of type
- After for this target unit to
- all SysV init script service
- units with an LSB header
- referring to the
- <literal>$time</literal>
- facility.</para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><filename>umount.target</filename></term>
- <listitem>
- <para>A special target unit
- that umounts all mount and
- automount points on system
- shutdown.</para>
-
- <para>Mounts that shall be
- unmounted on system shutdown
- shall add Conflicts
- dependencies to this unit for
- their mount unit, which is
- implicitly done when
- <varname>DefaultDependencies=yes</varname>
- is set (the default).</para>
- </listitem>
- </varlistentry>
- </variablelist>
- </refsect1>
-
- <refsect1>
- <title>Special User Units</title>
-
- <para>When systemd runs as a user instance, the
- following special units are available, which have
- similar definitions as their system counterparts:
- <filename>default.target</filename>,
- <filename>local-fs.target</filename>,
- <filename>remote-fs.target</filename>,
- <filename>shutdown.target</filename>,
- <filename>sockets.target</filename>,
- <filename>swap.target</filename>.</para>
-
- <para>In addition the following special unit is
- understood only when systemd runs as service instance:</para>
-
- <variablelist>
- <varlistentry>
- <term><filename>exit.service</filename></term>
- <listitem>
- <para>A special service unit
- for shutting down the
- user service manager.</para>
-
- <para>Applications wanting to
- terminate the user service
- manager should start this
- unit. If systemd receives
- SIGTERM or SIGINT when running
- as user service daemon it will
- start this unit.</para>
-
- <para>Normally, this pulls in
- <filename>shutdown.target</filename>
- which in turn should be
- conflicted by all units that
- want to be shut down on
- user service manager exit.</para>
- </listitem>
- </varlistentry>
- </variablelist>
- </refsect1>
-
- <refsect1>
- <title>See Also</title>
- <para>
- <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
- <citerefentry><refentrytitle>systemd.service</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
- <citerefentry><refentrytitle>systemd.socket</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
- <citerefentry><refentrytitle>systemd.target</refentrytitle><manvolnum>5</manvolnum></citerefentry>
- </para>
- </refsect1>
-
-</refentry>
commit 81e0d95604bbdd884aa003de155d5a40debd071d
Author: Lennart Poettering <lennart at poettering.net>
Date: Wed Feb 15 20:13:24 2012 +0100
login: document new sd_session_get_xxx() calls
diff --git a/Makefile.am b/Makefile.am
index 9762da1..bad55aa 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -2064,6 +2064,10 @@ MANPAGES_ALIAS += \
man/sd_login_monitor_get_fd.3 \
man/sd_session_get_uid.3 \
man/sd_session_get_seat.3 \
+ man/sd_session_get_service.3 \
+ man/sd_session_get_type.3 \
+ man/sd_session_get_class.3 \
+ man/sd_session_get_display.3 \
man/sd_pid_get_owner_uid.3 \
man/sd_pid_get_unit.3 \
man/sd_uid_is_on_seat.3 \
@@ -2079,6 +2083,10 @@ man/sd_login_monitor_flush.3: man/sd_login_monitor_new.3
man/sd_login_monitor_get_fd.3: man/sd_login_monitor_new.3
man/sd_session_get_uid.3: man/sd_session_is_active.3
man/sd_session_get_seat.3: man/sd_session_is_active.3
+man/sd_session_get_service.3: man/sd_session_is_active.3
+man/sd_session_get_type.3: man/sd_session_is_active.3
+man/sd_session_get_class.3: man/sd_session_is_active.3
+man/sd_session_get_display.3: man/sd_session_is_active.3
man/sd_pid_get_owner_uid.3: man/sd_pid_get_session.3
man/sd_pid_get_unit.3: man/sd_pid_get_session.3
man/sd_uid_is_on_seat.3: man/sd_uid_get_state.3
diff --git a/man/sd_session_is_active.xml b/man/sd_session_is_active.xml
index 5db305d..afdeed5 100644
--- a/man/sd_session_is_active.xml
+++ b/man/sd_session_is_active.xml
@@ -47,6 +47,9 @@
<refname>sd_session_get_uid</refname>
<refname>sd_session_get_seat</refname>
<refname>sd_session_get_service</refname>
+ <refname>sd_session_get_type</refname>
+ <refname>sd_session_get_class</refname>
+ <refname>sd_session_get_display</refname>
<refpurpose>Determine state of a specific session</refpurpose>
</refnamediv>
@@ -76,6 +79,24 @@
<paramdef>const char* <parameter>session</parameter></paramdef>
<paramdef>char** <parameter>service</parameter></paramdef>
</funcprototype>
+
+ <funcprototype>
+ <funcdef>int <function>sd_session_get_type</function></funcdef>
+ <paramdef>const char* <parameter>session</parameter></paramdef>
+ <paramdef>char** <parameter>type</parameter></paramdef>
+ </funcprototype>
+
+ <funcprototype>
+ <funcdef>int <function>sd_session_get_class</function></funcdef>
+ <paramdef>const char* <parameter>session</parameter></paramdef>
+ <paramdef>char** <parameter>class</parameter></paramdef>
+ </funcprototype>
+
+ <funcprototype>
+ <funcdef>int <function>sd_session_get_display</function></funcdef>
+ <paramdef>const char* <parameter>session</parameter></paramdef>
+ <paramdef>char** <parameter>display</parameter></paramdef>
+ </funcprototype>
</funcsynopsis>
</refsynopsisdiv>
@@ -111,6 +132,34 @@
<citerefentry><refentrytitle>free</refentrytitle><manvolnum>3</manvolnum></citerefentry>
call after use.</para>
+ <para><function>sd_session_get_type()</function> may
+ be used to determine the type of the session
+ identified by the specified session identifier. The
+ returned string is one of <literal>x11</literal>,
+ <literal>tty</literal> or
+ <literal>unspecified</literal> and needs to be freed
+ with the libc
+ <citerefentry><refentrytitle>free</refentrytitle><manvolnum>3</manvolnum></citerefentry>
+ call after use.</para>
+
+ <para><function>sd_session_get_class()</function> may
+ be used to determine the class of the session
+ identified by the specified session identifier. The
+ returned string is one of <literal>user</literal>,
+ <literal>greeter</literal> or
+ <literal>lock-screen</literal> and needs to be freed
+ with the libc
+ <citerefentry><refentrytitle>free</refentrytitle><manvolnum>3</manvolnum></citerefentry>
+ call after use.</para>
+
+ <para><function>sd_session_get_display()</function>
+ may be used to determine the X11 display of the
+ session identified by the specified session
+ identifier. The returned string is one of needs to be
+ freed with the libc
+ <citerefentry><refentrytitle>free</refentrytitle><manvolnum>3</manvolnum></citerefentry>
+ call after use.</para>
+
<para>If the <literal>session</literal> parameter of
any of these functions is passed as NULL the operation
is executed for the session the calling process is a
commit eb91400c68140c9e4dadc2510c42d82869656b24
Author: Lennart Poettering <lennart at poettering.net>
Date: Wed Feb 15 20:06:14 2012 +0100
units: reword rescue/emergency mode message to fit in 80chars
diff --git a/units/emergency.service b/units/emergency.service
index 234bafc..43a74d7 100644
--- a/units/emergency.service
+++ b/units/emergency.service
@@ -17,7 +17,7 @@ Before=shutdown.target
Environment=HOME=/root
WorkingDirectory=/root
ExecStartPre=-/bin/plymouth quit
-ExecStartPre=-/bin/echo 'Welcome to emergency mode. Use "systemctl default" or ^D to activate default mode.'
+ExecStartPre=-/bin/echo 'Welcome to emergency mode. Use "systemctl default" or ^D to enter default mode.'
ExecStart=-/sbin/sulogin
ExecStopPost=/bin/systemctl --fail --no-block default
StandardInput=tty-force
diff --git a/units/rescue.service.m4 b/units/rescue.service.m4
index 7dd8a22..310bbce 100644
--- a/units/rescue.service.m4
+++ b/units/rescue.service.m4
@@ -18,7 +18,7 @@ Before=shutdown.target
Environment=HOME=/root
WorkingDirectory=/root
ExecStartPre=-/bin/plymouth quit
-ExecStartPre=-/bin/echo 'Welcome to rescue mode. Use "systemctl default" or ^D to activate default mode.'
+ExecStartPre=-/bin/echo 'Welcome to rescue mode. Use "systemctl default" or ^D to enter default mode.'
m4_ifdef(`TARGET_FEDORA',
`EnvironmentFile=/etc/sysconfig/init
ExecStart=-/bin/bash -c "exec ${SINGLE}"',
commit e606bb61d09d00ecce5f51f793dfdd8c85122cc4
Author: Lennart Poettering <lennart at poettering.net>
Date: Wed Feb 15 20:05:49 2012 +0100
systemctl: introduce systemctl reboot -ff
diff --git a/TODO b/TODO
index cba2c8c..46d4c04 100644
--- a/TODO
+++ b/TODO
@@ -21,8 +21,6 @@ Bugfixes:
Features:
-* systemctl reboot -ff should trigger an immediate reboot
-
* support units generated by a generator and placed in /run/systemd/system/; the directory is
currently ignored because it is empty before the generatores are executed
diff --git a/man/systemctl.xml b/man/systemctl.xml
index 5adee45..3266333 100644
--- a/man/systemctl.xml
+++ b/man/systemctl.xml
@@ -349,14 +349,22 @@
<command>halt</command>,
<command>poweroff</command>,
<command>reboot</command> or
- <command>kexec</command> execute
+ <command>kexec</command> execute the
selected operation without shutting
down all units. However, all processes
will be killed forcibly and all file
systems are unmounted or remounted
read-only. This is hence a drastic but
relatively safe option to request an
- immediate reboot.</para></listitem>
+ immediate reboot. If
+ <option>--force</option> is specified
+ twice for these operations, they will
+ be executed immediately without
+ terminating any processes or umounting
+ any file systems. Warning: specifying
+ <option>--force</option> twice with
+ any of these operations might result
+ in data loss.</para></listitem>
</varlistentry>
<varlistentry>
@@ -1017,14 +1025,19 @@
system. This is mostly equivalent to
<command>start halt.target</command>
but also prints a wall message to all
- users. If
- combined with <option>--force</option>
- shutdown of all running services is
- skipped, however all processes are killed
- and all file systems are unmounted or
+ users. If combined with
+ <option>--force</option> shutdown of
+ all running services is skipped,
+ however all processes are killed and
+ all file systems are unmounted or
mounted read-only, immediately
- followed by the
- system halt.</para></listitem>
+ followed by the system halt. If
+ <option>--force</option> is specified
+ twice the the operation is immediately
+ executed without terminating any
+ processes or unmounting any file
+ systems. This may result in data
+ loss.</para></listitem>
</varlistentry>
<varlistentry>
<term><command>poweroff</command></term>
@@ -1033,32 +1046,40 @@
power-off the system. This is mostly
equivalent to <command>start
poweroff.target</command> but also
- prints a wall message to all
- users. If
+ prints a wall message to all users. If
combined with <option>--force</option>
shutdown of all running services is
- skipped, however all processes are killed
- and all file systems are unmounted or
- mounted read-only, immediately
- followed by the
- powering off.</para></listitem>
+ skipped, however all processes are
+ killed and all file systems are
+ unmounted or mounted read-only,
+ immediately followed by the powering
+ off. If <option>--force</option> is
+ specified twice the the operation is
+ immediately executed without
+ terminating any processes or
+ unmounting any file systems. This may
+ result in data loss.</para></listitem>
</varlistentry>
<varlistentry>
<term><command>reboot</command></term>
- <listitem><para>Shut down and
- reboot the system. This is mostly
- equivalent to <command>start
+ <listitem><para>Shut down and reboot
+ the system. This is mostly equivalent
+ to <command>start
reboot.target</command> but also
- prints a wall message to all
- users. If
+ prints a wall message to all users. If
combined with <option>--force</option>
shutdown of all running services is
- skipped, however all processes are killed
- and all file systems are unmounted or
- mounted read-only, immediately
- followed by the
- reboot.</para></listitem>
+ skipped, however all processes are
+ killed and all file systems are
+ unmounted or mounted read-only,
+ immediately followed by the reboot. If
+ <option>--force</option> is specified
+ twice the the operation is immediately
+ executed without terminating any
+ processes or unmounting any file
+ systems. This may result in data
+ loss.</para></listitem>
</varlistentry>
<varlistentry>
<term><command>kexec</command></term>
diff --git a/src/systemctl.c b/src/systemctl.c
index ab6d126..dc37030 100644
--- a/src/systemctl.c
+++ b/src/systemctl.c
@@ -77,7 +77,7 @@ static bool arg_no_reload = false;
static bool arg_dry = false;
static bool arg_quiet = false;
static bool arg_full = false;
-static bool arg_force = false;
+static int arg_force = 0;
static bool arg_ask_password = false;
static bool arg_failed = false;
static bool arg_runtime = false;
@@ -126,6 +126,7 @@ static OutputMode arg_output = OUTPUT_SHORT;
static bool private_bus = false;
static int daemon_reload(DBusConnection *bus, char **args);
+static void halt_now(int action);
static bool on_tty(void) {
static int t = -1;
@@ -1687,6 +1688,15 @@ static int start_special(DBusConnection *bus, char **args) {
assert(bus);
assert(args);
+ if (arg_force >= 2 && streq(args[0], "halt"))
+ halt_now(ACTION_HALT);
+
+ if (arg_force >= 2 && streq(args[0], "poweroff"))
+ halt_now(ACTION_POWEROFF);
+
+ if (arg_force >= 2 && streq(args[0], "reboot"))
+ halt_now(ACTION_POWEROFF);
+
if (arg_force &&
(streq(args[0], "halt") ||
streq(args[0], "poweroff") ||
@@ -4291,7 +4301,7 @@ static int systemctl_parse_argv(int argc, char *argv[]) {
break;
case 'f':
- arg_force = true;
+ arg_force ++;
break;
case ARG_NO_RELOAD:
@@ -5171,6 +5181,36 @@ done:
return 0;
}
+static void halt_now(int action) {
+
+ /* Make sure C-A-D is handled by the kernel from this
+ * point on... */
+ reboot(RB_ENABLE_CAD);
+
+ switch (action) {
+
+ case ACTION_HALT:
+ log_info("Halting.");
+ reboot(RB_HALT_SYSTEM);
+ break;
+
+ case ACTION_POWEROFF:
+ log_info("Powering off.");
+ reboot(RB_POWER_OFF);
+ break;
+
+ case ACTION_REBOOT:
+ log_info("Rebooting.");
+ reboot(RB_AUTOBOOT);
+ break;
+
+ default:
+ assert_not_reached("Unknown halt action.");
+ }
+
+ assert_not_reached("Uh? This shouldn't happen.");
+}
+
static int halt_main(DBusConnection *bus) {
int r;
@@ -5218,31 +5258,7 @@ static int halt_main(DBusConnection *bus) {
if (arg_dry)
return 0;
- /* Make sure C-A-D is handled by the kernel from this
- * point on... */
- reboot(RB_ENABLE_CAD);
-
- switch (arg_action) {
-
- case ACTION_HALT:
- log_info("Halting.");
- reboot(RB_HALT_SYSTEM);
- break;
-
- case ACTION_POWEROFF:
- log_info("Powering off.");
- reboot(RB_POWER_OFF);
- break;
-
- case ACTION_REBOOT:
- log_info("Rebooting.");
- reboot(RB_AUTOBOOT);
- break;
-
- default:
- assert_not_reached("Unknown halt action.");
- }
-
+ halt_now(arg_action);
/* We should never reach this. */
return -ENOSYS;
}
commit d4eb120a23e6a19a2886b517b64d5f260c5a4a21
Author: Lennart Poettering <lennart at poettering.net>
Date: Wed Feb 15 19:16:08 2012 +0100
machine-id: initialize vom qemu/kvm -uuid parameter if available
diff --git a/src/machine-id-setup.c b/src/machine-id-setup.c
index 531f3b2..d584181 100644
--- a/src/machine-id-setup.c
+++ b/src/machine-id-setup.c
@@ -33,6 +33,7 @@
#include "macro.h"
#include "util.h"
#include "log.h"
+#include "virt.h"
static int generate(char id[34]) {
int fd, r;
@@ -40,6 +41,7 @@ static int generate(char id[34]) {
sd_id128_t buf;
char *q;
ssize_t k;
+ const char *vm_id;
assert(id);
@@ -47,7 +49,7 @@ static int generate(char id[34]) {
fd = open("/var/lib/dbus/machine-id", O_RDONLY|O_CLOEXEC|O_NOCTTY|O_NOFOLLOW);
if (fd >= 0) {
- k = loop_read(fd, id, 33, false);
+ k = loop_read(fd, id, 32, false);
close_nointr_nofail(fd);
if (k >= 32) {
@@ -59,6 +61,43 @@ static int generate(char id[34]) {
}
}
+ /* If that didn't work, see if we are running in qemu/kvm and a
+ * machine ID was passed in via -uuid on the qemu/kvm command
+ * line */
+
+ r = detect_vm(&vm_id);
+ if (r > 0 && streq(vm_id, "kvm")) {
+ char uuid[37];
+
+ fd = open("/sys/class/dmi/id/product_uuid", O_RDONLY|O_CLOEXEC|O_NOCTTY|O_NOFOLLOW);
+ if (fd >= 0) {
+ k = loop_read(fd, uuid, 36, false);
+ close_nointr_nofail(fd);
+
+ if (k >= 36) {
+ unsigned i, j;
+
+ for (i = 0, j = 0; i < 36 && j < 32; i++) {
+ int t;
+
+ t = unhexchar(uuid[i]);
+ if (t < 0)
+ continue;
+
+ id[j++] = hexchar(t);
+ }
+
+ if (i == 36 && j == 32) {
+ id[32] = '\n';
+ id[33] = 0;
+
+ log_info("Initializing machine ID from KVM UUID");
+ return 0;
+ }
+ }
+ }
+ }
+
/* If that didn't work, generate a random machine id */
r = sd_id128_randomize(&buf);
if (r < 0) {
More information about the systemd-commits
mailing list