Re: Path monitoring support in s6-services

From: Ben Franksen <ben.franksen_at_online.de>
Date: Wed, 17 Feb 2021 20:29:09 +0100

Am 17.02.21 um 10:26 schrieb Casper Ti. Vector:
> On Wed, Feb 17, 2021 at 01:08:44PM +0530, billa chaitanya wrote:
>> I am trying to start a service when a file/path is
>> modified/touched/created.Do we have any mechanism in s6 that supports
>> enabling a service up on monitoring a path?
>
> inotifyd (or something similar) + s6-svc (or s6-rc)?

You can also write your own specialised daemon with a simple shell
script a la

inotifywait -q -m ... | while true; do
  # get the next event:
  event=$(head -1)
  ...
done

I am using this method in a production system.

Cheers
Ben
Received on Wed Feb 17 2021 - 19:29:09 UTC

This archive was generated by hypermail 2.3.0 : Sun May 09 2021 - 19:44:19 UTC