Subject: controlling service schedule

From: [email-masked]
Date: Wed, 7 Mar 2007 12:41:09 -0800

Does anyone know of a hack or other mechanism I can use to control exactly
when a service runs?  I have a couple of costly tests that I would like to
run only during the night, and preferably on a specific schedule.  I know
how to use cron to override on a schedule, but this doesn't prevent
execution.  I have considered doing a check-now via a cron, but in order
for this to work I would need to prevent the service from running on any
schedule.  Is this possible?  Any other ideas?

...Matt Cleveland
...Web Architect
...Health Net Inc
...916.935.1248
[email-masked]

* There's no place like 127.0.0.1

---------------------------------------------------------------------
This message, together with any attachments, is
intended only for the use of the individual or entity
to which it is addressed. It may contain information
that is confidential and prohibited from disclosure.
If you are not the intended recipient, you are hereby
notified that any dissemination or copying of this
message or any attachment is strictly prohibited. If
you have received this message in error, please notify
the original sender immediately by telephone or by
return e-mail and delete this message, along with any
attachments, from your computer. Thank you.

---------------------------------------------------------------------

---

From: [email-masked]
Date: Tue, 27 Mar 2007 08:12:18 -0700

After running with this for a while, it seems to not work completely.  I'm
not really sure why, but it only works the first day, and the test is never
run after that.  Instead of trouble shooting it, I'm going with a simpler
version of the solution.

Here's my solution.
1. I set up the Prog service to have a meaningless and harmless command.
This *effectively* disables the service.
2. I have a cron running at 01:01 that uses setParam to set the command to
the intended command.
3. I have a cron running at 01:02 that uses setParam to set the command
back to a meaningless and harmless command.

 group "Test" {
     Service Prog {
     command: <some harmless command, perhaps simply echoing the
expectation>
     expect: <some expectation>
     debug: true
     frequency: 60
     cron "1 1 * * *" {
         func: setparam
         param: prog::command
         value: <some real command>
     }
     cron "1 1 * * *" {
         func: setparam
         param: prog::command
         value: <some harmless command, perhaps simply echoing the
expectation>
     }
 }

...Matt Cleveland
...Web Architect
...Health Net Inc
...916.935.1248

Matt A Cleveland/RC/CA/HNI/HNT wrote on 03/09/2007 09:37:06 AM:

> Ok, I think I have a solution as explained below.  However I think
> this discussion points to 2 features that would be reasonable and
> useful.  First I think the disabled property should be exposed to be
> set by the config file.  Second I think a new property called
> cronspec should be added to all services, which could specify a
> specific schedule for the service.
>
> Here's my solution.
> 1. I set up the Prog service to have a meaningless and harmless
> command.  This *effectively* disables the service at startup.
> 2. I have a cron running on 1,3-60 that uses setParam to disable the
> Prog service.  This *actually* disables the service very quickly
> after startup.
> 3. I have a cron running at 01:01 that uses setParam to set the
> command to the intended command
> 4. I have a cron running at 01:02 that uses setParam to enable the
> Prog service
> 5. #2 above will then disable the Prog service again at 01:03.
>
> There is only a very, very brief potential gap if Argus was started
> up right at 01:01, where the command might be enabled and set to the
> correct command, and it might run before the intended time of 01:02,
> but this is an insignificant risk.
>
> Here's the whole config.
>
> group "Test" {
>     Service Prog {
>     command: echo 123
>     expect: 123
>     debug: true
>     frequency: 60
>     cron "1,3-60 * * * *" {
>         func: setparam
>         param: srvc::disabled
>         value: service is disabled except for nightly at 1:02
>     }
>     cron "1 1 * * *" {
>         func: setparam
>         param: prog::command
>         value: echo some real command
>     }
>     cron "2 1 * * *" {
>         func: setparam
>         param: srvc::disabled
>         #note: value must be left out of this setparam call, in
> order to actually re-enable the service.
>     }
> }
>
> ...Matt Cleveland
> ...Web Architect
> ...Health Net Inc
> ...916.935.1248

>
> Jeff Weisberg <[email-masked]>
> Sent by: [email-masked]
>
> 03/08/2007 09:17 AM
>
> Please respond to
> Discussion about Argus <[email-masked]>
>
> To
>
> [email-masked]
>
> cc
>
> Subject
>
> Re: controlling service schedule
>
>
> | I've tried
> | using runatstartup with an argusctl command, but it just hangs.  It
appears
> | that Argus is not ready to take commands at the moment when
runatstartup is
> | processed.
>
>
> if your runatstartup program wants to talk to argus, put an '&'
> after the command so it runs in the background. otherwise,
> argus will wait for it to finish.
>
>    runatstartup: /usr/bin/myprogram &
>
> _______________________________________________
> http://argus.tcp4me.com/
> [email-masked]
> http://www.tcp4me.com/mailman/listinfo/arguslist