supervision - discussion about system services, daemon supervision, init, runlevel management, and tools such as s6 and runit
 help / color / mirror / Atom feed
From: Ben Franksen <ben.franksen@online.de>
To: supervision@list.skarnet.org
Subject: Re: Path monitoring support in s6-services
Date: Wed, 17 Feb 2021 20:29:09 +0100	[thread overview]
Message-ID: <s0jqq5$nm3$1@ciao.gmane.io> (raw)
In-Reply-To: <YCzhY08cK0QqP/7v@CasperVector>

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


      parent reply	other threads:[~2021-02-17 19:35 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-17  7:38 billa chaitanya
2021-02-17  9:26 ` Casper Ti. Vector
2021-02-17 10:35   ` billa chaitanya
2021-02-17 12:06     ` Laurent Bercot
2021-02-17 12:58       ` billa chaitanya
2021-02-17 13:39         ` Laurent Bercot
2021-02-17 19:29   ` Ben Franksen [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='s0jqq5$nm3$1@ciao.gmane.io' \
    --to=ben.franksen@online.de \
    --cc=supervision@list.skarnet.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).