systemd.path.xml revision f848f8d87e3aafa514e8134e3ecf2317d89420e0
2N/A<?xml version='1.0'?> <!--*-nxml-*-->
2N/A<?xml-stylesheet type="text/xsl" href="http://docbook.sourceforge.net/release/xsl/current/xhtml/docbook.xsl"?>
2N/A<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
2N/A "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
2N/A
2N/A<!--
2N/A This file is part of systemd.
2N/A
2N/A Copyright 2010 Lennart Poettering
2N/A
2N/A systemd is free software; you can redistribute it and/or modify it
2N/A under the terms of the GNU Lesser General Public License as published by
2N/A the Free Software Foundation; either version 2.1 of the License, or
2N/A (at your option) any later version.
2N/A
2N/A systemd is distributed in the hope that it will be useful, but
2N/A WITHOUT ANY WARRANTY; without even the implied warranty of
2N/A MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
2N/A Lesser General Public License for more details.
2N/A
2790N/A You should have received a copy of the GNU Lesser General Public License
2790N/A along with systemd; If not, see <http://www.gnu.org/licenses/>.
5337N/A-->
2N/A
2N/A<refentry id="systemd.path">
2N/A <refentryinfo>
2N/A <title>systemd.path</title>
2N/A <productname>systemd</productname>
2N/A
3817N/A <authorgroup>
2N/A <author>
2N/A <contrib>Developer</contrib>
2N/A <firstname>Lennart</firstname>
59N/A <surname>Poettering</surname>
59N/A <email>lennart@poettering.net</email>
2N/A </author>
2N/A </authorgroup>
2N/A </refentryinfo>
2N/A
26N/A <refmeta>
26N/A <refentrytitle>systemd.path</refentrytitle>
2N/A <manvolnum>5</manvolnum>
26N/A </refmeta>
1470N/A
38N/A <refnamediv>
1470N/A <refname>systemd.path</refname>
1470N/A <refpurpose>Path unit configuration</refpurpose>
1470N/A </refnamediv>
181N/A
26N/A <refsynopsisdiv>
4811N/A <para><filename>systemd.path</filename></para>
4811N/A </refsynopsisdiv>
4811N/A
3739N/A <refsect1>
3739N/A <title>Description</title>
3739N/A
3739N/A <para>A unit configuration file whose name ends in
3739N/A <filename>.path</filename> encodes information about
3739N/A a path monitored by systemd, for
3739N/A path-based activation.</para>
3739N/A
3817N/A <para>This man page lists the configuration options
3817N/A specific to this unit type. See
26N/A <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>
26N/A for the common options of all unit configuration
26N/A files. The common configuration items are configured
26N/A in the generic [Unit] and [Install] sections. The
26N/A path specific configuration options are configured in
26N/A the [Path] section.</para>
26N/A
700N/A <para>For each path file, a matching unit file must
700N/A exist, describing the unit to activate when the path
26N/A changes. By default, a service by the same name as the
26N/A path (except for the suffix) is activated. Example: a
26N/A path file <filename>foo.path</filename> activates a
1498N/A matching service <filename>foo.service</filename>. The
1498N/A unit to activate may be controlled by
26N/A <varname>Unit=</varname> (see below).</para>
1498N/A
151N/A <para>Internally, path units use the
206N/A <citerefentry><refentrytitle>inotify</refentrytitle><manvolnum>7</manvolnum></citerefentry>
26N/A API to monitor file systems. Due to that, it suffers by the
26N/A same limitations as inotify, and for example cannot be
26N/A used to monitor files or directories changed by other
26N/A machines on remote NFS file systems.</para>
26N/A
3998N/A <para>If a path unit is beneath another mount
2818N/A point in the file system hierarchy, a dependency
2830N/A between both units is created automatically.</para>
3127N/A
3998N/A <para>Unless <varname>DefaultDependencies=</varname>
26N/A is set to <option>false</option>, path units will
3294N/A implicitly have dependencies of type
26N/A <varname>Conflicts=</varname> and
2N/A <varname>Before=</varname> on
4747N/A <filename>shutdown.target</filename>. These ensure
4437N/A that path units are terminated cleanly prior to system
4437N/A shutdown. Only path units involved with early boot or
4488N/A late system shutdown should disable this
4488N/A option.</para>
4437N/A </refsect1>
4437N/A
5425N/A <refsect1>
5425N/A <title>Options</title>
5425N/A
5425N/A <para>Path files must include a [Path] section,
5425N/A which carries information about the path(s) it
5425N/A monitors. The options specific to the [Path] section
5425N/A of path units are the following:</para>
5425N/A
5425N/A <variablelist>
5425N/A <varlistentry>
5425N/A <term><varname>PathExists=</varname></term>
5425N/A <term><varname>PathExistsGlob=</varname></term>
5425N/A <term><varname>PathChanged=</varname></term>
5425N/A <term><varname>PathModified=</varname></term>
5425N/A <term><varname>DirectoryNotEmpty=</varname></term>
5425N/A
5425N/A <listitem><para>Defines paths to
5425N/A monitor for certain changes:
5329N/A <varname>PathExists=</varname> may be
5329N/A used to watch the mere existence of a
5329N/A file or directory. If the file
5329N/A specified exists the configured unit
5349N/A is
2236N/A activated. <varname>PathExistsGlob=</varname>
2818N/A works similar, but checks for the
4910N/A existence of at least one file
2N/A matching the globbing pattern
5425N/A specified. <varname>PathChanged=</varname>
5425N/A may be used to watch a file or
5425N/A directory and activate the configured
5425N/A unit whenever it changes. It is not activated
5425N/A on every write to the watched file but it is
5425N/A activated if the file which was open for writing
5425N/A gets closed. <varname>PathModified=</varname>
26N/A is similar, but additionally it is activated
26N/A also on simple writes to the watched file.
181N/A
181N/A <varname>DirectoryNotEmpty=</varname>
4353N/A may be used to watch a directory and
4353N/A activate the configured unit whenever
4353N/A it contains at least one file.</para>
4488N/A
99N/A <para>The arguments of these
59N/A directives must be absolute file
12N/A system paths.</para>
30N/A
4811N/A <para>Multiple directives may be
4811N/A combined, of the same and of different
4811N/A types, to watch multiple paths.</para>
1256N/A
1256N/A <para>If a path is already existing
1256N/A (in case of
2818N/A <varname>PathExists=</varname> and
1256N/A <varname>PathExistsGlob=</varname>) or
1256N/A a directory already is not empty (in
1256N/A case of
1256N/A <varname>DirectoryNotEmpty=</varname>)
1256N/A at the time the path unit is
1256N/A activated, then the configured unit is
1256N/A immediately activated as
1256N/A well. Something similar does not apply
1256N/A to <varname>PathChanged=</varname>.
2818N/A </para></listitem>
1256N/A </varlistentry>
1256N/A <varlistentry>
1256N/A <term><varname>Unit=</varname></term>
1256N/A
1256N/A <listitem><para>The unit to activate
1256N/A when any of the configured paths
1256N/A changes. The argument is a unit name,
3109N/A whose suffix is not
3109N/A <filename>.path</filename>. If not
3109N/A specified, this value defaults to a
3109N/A service that has the same name as the
3109N/A path unit, except for the suffix. (See
3109N/A above.) It is recommended that the
3109N/A unit name that is activated and the
3109N/A unit name of the path unit are named
3109N/A identical, except for the
3109N/A suffix.</para></listitem>
3109N/A </varlistentry>
3109N/A <varlistentry>
3109N/A <term><varname>MakeDirectory=</varname></term>
3109N/A
3109N/A <listitem><para>Takes a boolean
3109N/A argument. If true the directories to
3109N/A watch are created before
1256N/A watching. This option is ignored for
1256N/A <varname>PathExists=</varname>
1256N/A settings. Defaults to
3109N/A <option>false</option>.</para></listitem>
4811N/A </varlistentry>
1256N/A <varlistentry>
26N/A <term><varname>DirectoryMode=</varname></term>
26N/A
1256N/A <listitem><para>If
2N/A <varname>MakeDirectory=</varname> is
26N/A enabled use the mode specified here to
1256N/A create the directories in
1256N/A question. Takes an access mode in
185N/A octal notation. Defaults to
2N/A <option>0755</option>.</para></listitem>
255N/A </varlistentry>
145N/A </variablelist>
7N/A </refsect1>
26N/A
26N/A <refsect1>
38N/A <title>See Also</title>
26N/A <para>
197N/A <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
197N/A <citerefentry><refentrytitle>systemctl</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
197N/A <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
197N/A <citerefentry><refentrytitle>systemd.service</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
197N/A <citerefentry><refentrytitle>inotify</refentrytitle><manvolnum>7</manvolnum></citerefentry>
26N/A </para>
30N/A </refsect1>
26N/A
46N/A</refentry>
46N/A