Here are my .path and .service files:
$ cat /etc/systemd/system/trigg.path
[Path]
DirectoryNotEmpty=/root/trigger
MakeDirectory=true
[Path]
DirectoryNotEmpty=/root/trigger
MakeDirectory=true
$ cat /etc/systemd/system/trigg.service
[Unit]
Description=Trigger Service
[Service]
ExecStart=/usr/bin/touch /root/wastriggered
Type=oneshot
[Unit]
Description=Trigger Service
[Service]
ExecStart=/usr/bin/touch /root/wastriggered
Type=oneshot
Now, after robooting, I would have expected that /root/trigger would exist; it does not. And, of course, creating it manually and touching a file in there does not trigger the path.
What am I missing? I have successfully used .path units in the past, and what I'm doing here looks right; unfortunately I do not have access to those old machines any more (previous employer).
$ systemd --version
systemd 245 (245.4-4ubuntu3.15)
+PAM +AUDIT +SELINUX +IMA +APPARMOR +SMACK +SYSVINIT +UTMP +LIBCRYPTSETUP +GCRYPT +GNUTLS +ACL +XZ +LZ4 +SECCOMP +BLKID +ELFUTILS +KMOD +IDN2 -IDN +PCRE2 default-hierarchy=hybrid