Hey - ya snooze, ya looze! ;\)

I'm using SrvAny, as I documented in the Script Vault article "Running Kix as a Service". SrvAny.exe controls the process that is defined. WKix32.exe is the application to run, and the script (and any args) is the parameter. Stopping SrvAny (the "KixService" service) terminates WKix32, which stops the script itself. That's why I was feeling challenged about restarting the service / script.

I'm going to test Fake Allen's solution tonight - I'm pretty sure that stopping it will stop the child, which is actually the main script. If that works, I'm home-free for a self-updating service.

The service itself is fairly simple, but performs many different scheduled tasks. All times are relative to service start and not time of day, with two exceptions.
  • Midnight - the log file name is changed, effectively resulting in a daily log rotation, and any log more than 30 days old is removed.
  • 5am - a system-wide health check is performed by the Master Cylind - er - server. All SRV records are retrieved from DNS, each subordinate server is queried to insure it is responding, logging, and has a current replication of the data folder.
  • Every hour:
    :15 after startup - If Primary, check for changes and set MODIFIED flag
    :30 after startup - Update the local product index
    :45 after startup - If Primary, validate the content, remove any unauthorised files
    :60 after startup - If not primary, determine if a Folder Sync is needed
  • Every 6 minutes - Perform log consolodation, forwarding logs upstream to master server
  • Every 2 minutes - If Primary or Secondary, check for sync requests and queue up to 20 sync processes.
With this in place, we can make a change to the primary server in the HQ location, and within 2 hours, that change is replicated to 160+ remote sites. Any process performed at the remote site is logged, and the logs are pushed upstream and consolidated/sorted on the primary server, again within a few hours. The sync time depends on the hierarchy - secondry and slaves that use the primary as their peer sync up within no more than 2 hours, while servers that sync with a secondary server can take up to 3 hours to sync. For our application, this is very fast, since the design spec was complete propogation within 24 hours.

Every server is listed in DNS with a SRV record, which identifies the hostname, host IP, subnet served, Class (primary/secondary/slave) and service communication port. With a simple DNS query, I can identify every server that provides this service, the server that provides service to my subnet, and - if the script is running on a server, what class of service it should provide.

I'll let you know how the "dumb" process works out, but am still open to ideas.

Thanks

Glenn
_________________________
Actually I am a Rocket Scientist! \:D