<div dir="auto"><div><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, Mar 20, 2022, 23:27 John Ioannidis <<a href="mailto:systemd-devel@tla.org">systemd-devel@tla.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>Here are my .path and .service files:</div><div><br></div><div><font face="monospace">$ <b>cat /etc/systemd/system/trigg.path </b><br>[Path]<br>DirectoryNotEmpty=/root/trigger<br>MakeDirectory=true<br></font></div><div><font face="monospace"><br></font></div><div><font face="monospace">$ <b>cat /etc/systemd/system/trigg.service </b><br>[Unit]<br>Description=Trigger Service<br><br>[Service]<br>ExecStart=/usr/bin/touch /root/wastriggered<br>Type=oneshot<br></font></div><div><br></div><div><br></div><div>Now, after robooting, I would have expected that <span style="font-family:monospace">/root/trigger </span>would exist; it does not. And, of course, creating it manually and touching a file in there does not trigger the path.</div><div><br></div><div>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).</div></div></blockquote></div></div><div dir="auto"><br></div><div dir="auto">Seems like there's nothing that would activate your .path unit itself – path watches or timer schedules are only established while the .path or the .timer is "started". So you will usually need:</div><div dir="auto"><br></div><div dir="auto">[Install]</div><div dir="auto">WantedBy=paths.target</div><div dir="auto"><br></div><div dir="auto">and the corresponding 'systemctl enable'.</div></div>