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.
How to do this?? Can I use the same method which you mentioned? On Wed, 12 Sep 2018, 7:09 pm Mantas Mikulėnas, <graw...@gmail.com> wrote: > On Wed, Sep 12, 2018 at 4:19 PM deepan muthusamy <deepan.m2...@gmail.com> > wrote: > >> Can anyone give a demo of how path based activation works? >> >> I referred cups Daemon, but the same thing not working for me.. >> > > 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. > > foo.path: > [Path] > PathModified=/tmp/something.txt > > foo.service: > [Service] > Type=oneshot > ExecStart=/bin/cp -av /tmp/something.txt /tmp/backup.txt > > # systemctl start foo.path > # echo Hello > /tmp/something.txt > # ls -l /tmp/{something,backup}.txt > > -- > Mantas Mikulėnas >
_______________________________________________ systemd-devel mailing list systemd-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/systemd-devel