[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: RFC: OpenRC as Init System for Debian

Patrick Lauer <patrick@gentoo.org> writes:
> On 05/08/12 00:04, Marco d'Itri wrote:
>> On May 07, Ben Hutchings <ben@decadent.org.uk> wrote:
>>> Means that services can be started (and stopped?) in response to events
>>> such as hardware discovery, incoming network connections, the status of
>>> other services, and so on.  (With dependencies still taken into
>>> account.)
>> I want to add another major event: the service exiting.
>> Being able to reliably monitor and automatically restart a failed 
>> service is critical.
> well, that's another 10 lines of shell worst case. We haven't agreed on
> how exactly to handle it and make it configurable and stuff (especially
> as tools like monit cover that niche better)
> but - here's the magic:
> $ cat /sys/fs/cgroup/openrc/release_agent
> /lib64/rc/sh/cgroup-release-agent.sh
> So, whenever a CGroup becomes empty we trigger a script. That script now
> can do ... well ... everything.
> Including restarting ${SVCNAME}.
> Where we disagree is mostly the policy - is that enabled by default?
> (potentially bad)
> What if a service gets restarted multiple times? (infinite loop)
> Do we want to add a general notifier? (send an email, "foo crashed, I
> restarted it)
> Apart from that it's trivial to add restarting functionality.

That doesn't sound trivial at all. Your shell script will be invoked
anew every time the service exits. That means in order to do anything
non-trivial (like rate limiting), you now need to manage an internal
state between invocations. To me a continuously running daemon sounds
like a much more robust solution here than a collection of scripts that
communicate via some set of files.



 »Time flies like an arrow, fruit flies like a Banana.«

  PGP fingerprint: 5B93 61F8 4EA2 E279 ABF6  02CF A9AD B7F8 AE4E 425C

Reply to: