supervision - discussion about system services, daemon supervision, init, runlevel management, and tools such as s6 and runit
 help / color / mirror / Atom feed
* Path monitoring support in s6-services
@ 2021-02-17  7:38 billa chaitanya
  2021-02-17  9:26 ` Casper Ti. Vector
  0 siblings, 1 reply; 7+ messages in thread
From: billa chaitanya @ 2021-02-17  7:38 UTC (permalink / raw)
  To: supervision

[-- Attachment #1: Type: text/plain, Size: 194 bytes --]

Hi Team,

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?

Thanks,
Chaitanya

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Path monitoring support in s6-services
  2021-02-17  7:38 Path monitoring support in s6-services billa chaitanya
@ 2021-02-17  9:26 ` Casper Ti. Vector
  2021-02-17 10:35   ` billa chaitanya
  2021-02-17 19:29   ` Ben Franksen
  0 siblings, 2 replies; 7+ messages in thread
From: Casper Ti. Vector @ 2021-02-17  9:26 UTC (permalink / raw)
  To: supervision

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)?

-- 
My current OpenPGP key:
RSA4096/0x227E8CAAB7AA186C (expires: 2022.09.20)
7077 7781 B859 5166 AE07 0286 227E 8CAA B7AA 186C


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Path monitoring support in s6-services
  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 19:29   ` Ben Franksen
  1 sibling, 1 reply; 7+ messages in thread
From: billa chaitanya @ 2021-02-17 10:35 UTC (permalink / raw)
  To: supervision

[-- Attachment #1: Type: text/plain, Size: 711 bytes --]

>
> inotifyd (or something similar) + s6-svc (or s6-rc)?
>
Thought of the same but I have many such services;Just thinking of cpu
overhead during the initial boot up.

Thanks,
Chaitnaya

On Wed, Feb 17, 2021 at 2:57 PM Casper Ti. Vector <caspervector@gmail.com>
wrote:

> 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)?
>
> --
> My current OpenPGP key:
> RSA4096/0x227E8CAAB7AA186C (expires: 2022.09.20)
> 7077 7781 B859 5166 AE07 0286 227E 8CAA B7AA 186C
>
>

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Path monitoring support in s6-services
  2021-02-17 10:35   ` billa chaitanya
@ 2021-02-17 12:06     ` Laurent Bercot
  2021-02-17 12:58       ` billa chaitanya
  0 siblings, 1 reply; 7+ messages in thread
From: Laurent Bercot @ 2021-02-17 12:06 UTC (permalink / raw)
  To: supervision

>>  inotifyd (or something similar) + s6-svc (or s6-rc)?
>Thought of the same but I have many such services;Just thinking of cpu
>overhead during the initial boot up.

  What makes you think this would have a noticeable impact on your CPU
load?

--
  Laurent


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Path monitoring support in s6-services
  2021-02-17 12:06     ` Laurent Bercot
@ 2021-02-17 12:58       ` billa chaitanya
  2021-02-17 13:39         ` Laurent Bercot
  0 siblings, 1 reply; 7+ messages in thread
From: billa chaitanya @ 2021-02-17 12:58 UTC (permalink / raw)
  To: Laurent Bercot; +Cc: supervision

[-- Attachment #1: Type: text/plain, Size: 595 bytes --]

>
>
>   What makes you think this would have a noticeable impact on your CPU
> load?
>

Since it requires individual instances of inotifyd for each service(s)
[which depends on  multiple files/paths modifications) to get started]

On Wed, Feb 17, 2021 at 5:36 PM Laurent Bercot <ska-supervision@skarnet.org>
wrote:

> >>  inotifyd (or something similar) + s6-svc (or s6-rc)?
> >Thought of the same but I have many such services;Just thinking of cpu
> >overhead during the initial boot up.
>
>   What makes you think this would have a noticeable impact on your CPU
> load?
>
> --
>   Laurent
>
>

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Path monitoring support in s6-services
  2021-02-17 12:58       ` billa chaitanya
@ 2021-02-17 13:39         ` Laurent Bercot
  0 siblings, 0 replies; 7+ messages in thread
From: Laurent Bercot @ 2021-02-17 13:39 UTC (permalink / raw)
  To: supervision

>Since it requires individual instances of inotifyd for each service(s)
>[which depends on  multiple files/paths modifications) to get started]

  Have you tried it and noticed an impact on your boot times?
(AKA: "Profile, don't speculate.")

--
  Laurent


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Path monitoring support in s6-services
  2021-02-17  9:26 ` Casper Ti. Vector
  2021-02-17 10:35   ` billa chaitanya
@ 2021-02-17 19:29   ` Ben Franksen
  1 sibling, 0 replies; 7+ messages in thread
From: Ben Franksen @ 2021-02-17 19:29 UTC (permalink / raw)
  To: supervision

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


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2021-02-17 19:35 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-17  7:38 Path monitoring support in s6-services 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 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).