[systemd-commits] 3 commits - autogen.sh man/systemd.service.xml man/systemd.unit.xml
Zbigniew JÄdrzejewski-Szmek
zbyszek at kemper.freedesktop.org
Sat Dec 14 14:33:30 PST 2013
autogen.sh | 6 +-
man/systemd.service.xml | 103 +++++++++++++++++++++++++++++++++++++-----------
man/systemd.unit.xml | 11 +++++
3 files changed, 95 insertions(+), 25 deletions(-)
New commits:
commit 6baf995c17a95ca0d6b5ad0b1f1667c956574816
Author: Zbigniew JÄdrzejewski-Szmek <zbyszek at in.waw.pl>
Date: Sat Dec 14 17:30:25 2013 -0500
man: remove advice to avoid setting the same var more than once
So far the compatibility with .desktop settings hasn't been imporant
at all, and we do not want people to write convoluted unit
files.
diff --git a/man/systemd.service.xml b/man/systemd.service.xml
index 103c495..f6b9fe2 100644
--- a/man/systemd.service.xml
+++ b/man/systemd.service.xml
@@ -321,11 +321,7 @@
(these semicolons must be passed as
separate words). Alternatively, this
directive may be specified more than
- once with the same effect. However,
- the latter syntax is not recommended
- for compatibility with parsers
- suitable for XDG
- <filename>.desktop</filename> files.
+ once with the same effect.
Lone semicolons may be escaped as
<literal>\;</literal>. If the empty
string is assigned to this option, the
diff --git a/man/systemd.unit.xml b/man/systemd.unit.xml
index 35dd4c7..8d6acc7 100644
--- a/man/systemd.unit.xml
+++ b/man/systemd.unit.xml
@@ -120,6 +120,17 @@
<citerefentry><refentrytitle>systemd.scope</refentrytitle><manvolnum>5</manvolnum></citerefentry>.
</para>
+ <para>Various settings are allowed to be specified
+ more than once, in which case the interpretation
+ depends on the setting. Often, multiple settings form
+ a list, and setting to an empty value "resets", which
+ means that previous assignments are ignored. When this
+ is allowed, it is mentioned in the description of the
+ setting. Note that using multiple assignments to the
+ same value makes the unit file incompatible with
+ parsers for the XDG <filename>.desktop</filename> file
+ format.</para>
+
<para>Unit files are loaded from a set of paths
determined during compilation, described in the next section.
</para>
commit ec6039bc08f8e77f92427afec048e4f8ac4b81a8
Author: Zbigniew JÄdrzejewski-Szmek <zbyszek at in.waw.pl>
Date: Sat Dec 14 17:21:55 2013 -0500
man: beef up ExecStart description
We have lots of questions from people who assume that shell syntax works
here, so let's be very explicit what is allowed and what is not. A few
examples should also help.
http://bugs.debian.org/732156
diff --git a/man/systemd.service.xml b/man/systemd.service.xml
index 22c0d5a..103c495 100644
--- a/man/systemd.service.xml
+++ b/man/systemd.service.xml
@@ -305,9 +305,10 @@
<term><varname>ExecStart=</varname></term>
<listitem><para>Commands with their
arguments that are executed when this
- service is started. The first
- argument must be an absolute path
- name.</para>
+ service is started. For each of the
+ specified commands, the first argument
+ must be an absolute and literal path
+ to an executable.</para>
<para>When <varname>Type</varname> is
not <option>oneshot</option>, only one
@@ -332,6 +333,35 @@
prior assignments of this option will
have no effect.</para>
+ <para>Each command line is split on
+ whitespace, with the first item being
+ the command to execute, and the
+ subsequent items being the arguments.
+ Double quotes ("...") and single
+ quotes ('...') may be used, in which
+ case everything until the next
+ matching quote becomes part of the
+ same argument. Quotes themselves are
+ removed after parsing. In addition, a
+ trailing backslash
+ (<literal>\</literal>) may be used to
+ merge lines. This syntax is intended
+ to be very similar to shell syntax,
+ but only the meta-characters and
+ expansions described in the following
+ paragraphs are understood.
+ Specifically, redirection using
+ <literal><</literal>,
+ <literal><<</literal>,
+ <literal>></literal>, and
+ <literal>>></literal>, pipes
+ using <literal>|</literal>, and
+ running programs in the background
+ using <literal>&</literal>
+ and <emphasis>other elements of shell
+ syntax are not supported</emphasis>.
+ </para>
+
<para>If more than one command is
specified, the commands are invoked
one by one sequentially in the order
@@ -350,10 +380,11 @@
<para>The command line accepts
<literal>%</literal> specifiers as
described in
- <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>. Note
- that the first argument of the command
- line (i.e. the program to execute) may
- not include specifiers.</para>
+ <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>.
+ Note that the first argument of the
+ command line (i.e. the program to
+ execute) may not include
+ specifiers.</para>
<para>Basic environment variable
substitution is supported. Use
@@ -372,9 +403,7 @@
more arguments. To pass a literal dollar sign,
use <literal>$$</literal>. Note that the first
argument (i.e. the program to execute)
- may not be a variable, since it must
- be a literal and absolute path
- name.</para>
+ may not be a variable.</para>
<para>Optionally, if the absolute file
name is prefixed with
@@ -402,13 +431,47 @@
<programlisting>ExecStart=/bin/sh -c 'dmesg | tac'
</programlisting>
- <para>For services run by a user
- instance of systemd the special
- environment variable
- <varname>$MANAGERPID</varname> is set
- to the PID of the systemd
- instance.</para>
- </listitem>
+ <para>Only select environment variables
+ are set for executed commands. See
+ <citerefentry><refentrytitle>systemd.exec</refentrytitle><manvolnum>5</manvolnum></citerefentry>.
+ </para>
+
+ <para>Example:</para>
+ <programlisting>ExecStart=/bin/echo one ; /bin/echo "two two"
+ </programlisting>
+ <para>This will execute
+ <command>/bin/echo</command> two
+ times, each time with one argument,
+ <literal>one</literal> and
+ <literal>two two</literal>,
+ respectively. Since two commands are
+ specified
+ <varname>Type=oneshot</varname> must
+ be used.</para>
+
+ <para>Example:</para>
+ <programlisting>ExecStart=/bin/echo / >/dev/null & \; \
+/bin/ls
+ </programlisting>
+ <para>This will execute
+ <command>/bin/echo</command> with five
+ arguments: <literal>/</literal>,
+ <literal>>/dev/null</literal>,
+ <literal>&</literal>,
+ <literal>;</literal>, and
+ <literal>/bin/ls</literal>.</para>
+
+ <para>Example:</para>
+ <programlisting>Environment="ONE=one" 'TWO=two two'
+ExecStart=/bin/echo $ONE $TWO ${TWO}
+ </programlisting>
+ <para>This will execute
+ <command>/bin/echo</command> with four
+ arguments: <literal>one</literal>,
+ <literal>two</literal>,
+ <literal>two</literal>, and
+ <literal>two two</literal>.</para>
+ </listitem>
</varlistentry>
<varlistentry>
commit 5d5f8ffa077b0f4716d5178734601a0c27f575df
Author: Shawn Landden <shawn at churchofgit.com>
Date: Sat Dec 14 09:27:44 2013 -0800
build: use -ftrapv for development
We want to find these bugs if they exist.
diff --git a/autogen.sh b/autogen.sh
index d0a2f3f..9ffd724 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -54,10 +54,10 @@ args="$args \
fi
if [ "x$1" = "xc" ]; then
- ./configure CFLAGS='-g -O0' --enable-kdbus $args
+ ./configure CFLAGS='-g -O0 -ftrapv' --enable-kdbus $args
make clean
elif [ "x$1" = "xg" ]; then
- ./configure CFLAGS='-g -Og' --enable-kdbus $args
+ ./configure CFLAGS='-g -Og -ftrapv' --enable-kdbus $args
make clean
else
echo
@@ -65,6 +65,6 @@ else
echo "Initialized build system. For a common configuration please run:"
echo "----------------------------------------------------------------"
echo
- echo "./configure CFLAGS='-g -O0' --enable-kdbus $args"
+ echo "./configure CFLAGS='-g -O0 -ftrapv' --enable-kdbus $args"
echo
fi
More information about the systemd-commits
mailing list