[systemd-devel] Path based activation

Mantas Mikulėnas grawity at gmail.com
Wed Sep 12 13:39:03 UTC 2018


On Wed, Sep 12, 2018 at 4:19 PM deepan muthusamy <deepan.m2903 at 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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/systemd-devel/attachments/20180912/936c609a/attachment.html>


More information about the systemd-devel mailing list