2N/A<?
xml version='1.0'?>
<!--*-nxml-*--> 2N/A<!
DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" 2N/A This file is part of systemd. 2N/A Copyright 2010 Lennart Poettering 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 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. 2790N/A You should have received a copy of the GNU Lesser General Public License 2N/A <
productname>systemd</
productname>
2N/A <
contrib>Developer</
contrib>
2N/A <
firstname>Lennart</
firstname>
59N/A <
surname>Poettering</
surname>
59N/A <
email>lennart@poettering.net</
email>
2N/A <
manvolnum>5</
manvolnum>
1470N/A <
refpurpose>Path unit configuration</
refpurpose>
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>
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>
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
1498N/A unit to activate may be controlled by
26N/A <
varname>Unit=</
varname> (see below).</
para>
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>
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>
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
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
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 <
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 <
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
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 <
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>
99N/A <
para>The arguments of these
59N/A directives must be absolute file
12N/A system paths.</
para>
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 <
para>If a path is already existing
2818N/A <
varname>PathExists=</
varname> and
1256N/A <
varname>PathExistsGlob=</
varname>) or
1256N/A a directory already is not empty (in
1256N/A <
varname>DirectoryNotEmpty=</
varname>)
1256N/A at the time the path unit is
1256N/A activated, then the configured unit is
1256N/A well. Something similar does not apply
1256N/A to <
varname>PathChanged=</
varname>.
1256N/A <
term><
varname>Unit=</
varname></
term>
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 <
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 <
term><
varname>MakeDirectory=</
varname></
term>
3109N/A <
listitem><
para>Takes a boolean
3109N/A argument. If true the directories to
1256N/A watching. This option is ignored for
1256N/A <
varname>PathExists=</
varname>
3109N/A <
option>false</
option>.</
para></
listitem>
26N/A <
term><
varname>DirectoryMode=</
varname></
term>
2N/A <
varname>MakeDirectory=</
varname> is
26N/A enabled use the mode specified here to
1256N/A question. Takes an access mode in
185N/A octal notation. Defaults to
2N/A <
option>0755</
option>.</
para></
listitem>
38N/A <
title>See Also</
title>
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>