On Wed, Sep 12, 2018 at 4:19 PM deepan muthusamy <[email protected]>
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
[email protected]
https://lists.freedesktop.org/mailman/listinfo/systemd-devel

Reply via email to