[systemd-devel] Path based activation
deepan muthusamy
deepan.m2903 at gmail.com
Wed Sep 12 13:47:40 UTC 2018
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, <grawity at gmail.com> wrote:
> 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/12b24ae0/attachment.html>
More information about the systemd-devel
mailing list