<div dir="auto"><span style="font-family:sans-serif;font-size:12.8px">In my case , I want to check whether the filesystem path is available or not ( for example, /run/user/0). If this path is available I want to start my service.</span><div dir="auto" style="font-family:sans-serif;font-size:12.8px"><br></div><div dir="auto" style="font-family:sans-serif;font-size:12.8px">How to do this?? Can I use the same method which you mentioned?</div></div><br><div class="gmail_quote"><div dir="ltr">On Wed, 12 Sep 2018, 7:09 pm Mantas Mikulėnas, <<a href="mailto:grawity@gmail.com">grawity@gmail.com</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 class="gmail_quote"><div dir="ltr">On Wed, Sep 12, 2018 at 4:19 PM deepan muthusamy <<a href="mailto:deepan.m2903@gmail.com" target="_blank" rel="noreferrer">deepan.m2903@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="auto">Can anyone give a demo of how path based activation works?<div dir="auto"><br></div><div dir="auto">I referred cups Daemon, but the same thing not working for me..</div></div></blockquote><div><br></div><div>Path based activation is one of the simpler types – it waits for inotify events on the specified locations, and starts your service on any events. Note that it *does not* forward the event information to the service – that needs to be handled by the program itself.</div><div><br></div><div><font face="monospace, monospace">foo.path:</font></div><div><font face="monospace, monospace">[Path]</font></div><div><font face="monospace, monospace">PathModified=/tmp/something.txt</font></div><div><font face="monospace, monospace"><br></font></div><div><font face="monospace, monospace">foo.service:</font></div><div><font face="monospace, monospace">[Service]</font></div><div><font face="monospace, monospace">Type=oneshot</font></div><div><font face="monospace, monospace">ExecStart=/bin/cp -av /tmp/something.txt /tmp/backup.txt</font></div><div><font face="monospace, monospace"><br></font></div><div><font face="monospace, monospace"># systemctl start foo.path</font></div><div><font face="monospace, monospace"># echo Hello > /tmp/something.txt</font></div><div><font face="monospace, monospace"># ls -l /tmp/{something,backup}.txt</font></div></div><div><br></div>-- <br><div dir="ltr" class="m_2806404334097827698gmail_signature" data-smartmail="gmail_signature"><div dir="ltr">Mantas Mikulėnas</div></div></div>
</blockquote></div>