From 4885a78c1cf683a8e1097fc494f58e16125c769f Mon Sep 17 00:00:00 2001 From: Wytze van der Raay Date: Mon, 28 Dec 2009 15:09:24 +0000 Subject: [PATCH] Add proper startup/shutdown script for the CAcert CommModule processes. Add separate commdaemon script to control looping of basic script, and allow orderly shutdown. Add hook to client.pl script to interact properly with the new commmodule and commdaemon scripts. --- CommModule/client.pl | 2 +- CommModule/commdaemon | 45 ++++++++++++ CommModule/commmodule | 166 ++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 212 insertions(+), 1 deletion(-) create mode 100755 CommModule/commdaemon create mode 100755 CommModule/commmodule diff --git a/CommModule/client.pl b/CommModule/client.pl index fb643fc..930912e 100755 --- a/CommModule/client.pl +++ b/CommModule/client.pl @@ -1120,7 +1120,7 @@ sub HandleGPG() my $crlcheck=0; -while(1) +while ( -f "./client.pl-active" ) { SysLog("Handling GPG database ...\n"); HandleGPG(); diff --git a/CommModule/commdaemon b/CommModule/commdaemon new file mode 100755 index 0000000..75e5ba8 --- /dev/null +++ b/CommModule/commdaemon @@ -0,0 +1,45 @@ +#! /bin/bash +# @(#)(CAcert) $Id: commdaemon,v 1.1 2009/12/28 15:09:24 wytze Exp $ +# commdaemon - script to run CommModule script in a loop, +# while checking for removal of activation by external script + +NAME=CommModule/commdaemon +PID=$$ +TAG=${NAME}\[${PID}] + +case $# in + 1) SCRIPT=$1 + ACTIVE=${SCRIPT}-active + ;; + *) echo "Usage: $0