Name

systemd.path — systemd path configuration files

Synopsis

systemd.path

Options

Path files must include a [Path] section, which carries information about the path(s) it monitors. The options specific to the [Path] section of path units are the following:

PathExists=, PathExistsGlob=, PathChanged=, DirectoryNotEmpty=

Defines paths to monitor for certain changes: PathExists= may be used to watch the mere existence of a file or directory. If the file specified exists the configured unit is activated. PathExistsGlob= works similar, but checks for the existance of at least one file matching the globbing pattern specified. PathChanged= may be used to watch a file or directory and activate the configured unit whenever it changes or is modified. DirectoryNotEmpty= may be used to watch a directory and activate the configured unit whenever it contains at least one file.

The arguments of these directives must be absolute file system paths.

Multiple directives may be combined, of the same and of different types, to watch multiple paths.

If a path is already existing (in case of PathExists= and PathExistsGlob=) or a directory already is not empty (in case of DirectoryNotEmpty=) at the time the path unit is activated, then the configured unit is immediately activated as well. Something similar does not apply to PathChanged=. The latter is not activated on simple writes but only if files with were opened for writing are closed.

Unit=

The unit to activate when any of the configured paths changes. The argument is a unit name, whose suffix is not .path. If not specified, this value defaults to a service that has the same name as the path unit, except for the suffix. (See above.) It is recommended that the unit name that is activated and the unit name of the path unit are named identical, except for the suffix.

MakeDirectory=

Takes a boolean argument. If true the directories to watch are created before watching. This option is ignored for PathExists= settings. Defaults to false.

DirectoryMode=

If MakeDirectory= is enabled use the mode specified here to create the directories in question. Takes an access mode in octal notation. Defaults to 0755.