Forum: Cfengine Help
Subject: Re: How to extract values (not keys) from an array to slist?
Author: sauer
Link to topic: https://cfengine.com/forum/read.php?3,21174,21214#msg-21214
I wonder if you could just make an slist of the services you want to keep
running, and use something like
returnszero("service $(services) status")
to define classes which indicate whether restart is needed or not. Then you
don't need to know the process names or otherwise spread information around;
you keep all of the knowledge about how a service is stopped, started, and
checked within the init script where it, IMHO, belongs. :) You're already
using service to start and stop...
Alternatively, you write a simple shell wrapper which uses the module protocol
to raise or lower a class (say, service_runing) based on using the service
program; I've had some issues with returnszero working the way I'd like, and
you get better control over I/O with a module script anyway.
_______________________________________________
Help-cfengine mailing list
[email protected]
https://cfengine.org/mailman/listinfo/help-cfengine