From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.sysutils.supervision.general/1710 Path: news.gmane.org!not-for-mail From: Joan Picanyol i Puig Newsgroups: gmane.comp.sysutils.supervision.general Subject: Re: Help with chpst -e Date: Tue, 15 Apr 2008 00:17:38 +0200 Message-ID: <20080414221738.GA3519@grummit.biaix.org> References: <20080414083428.GK20279@utopia.intra.guy> <20080414164126.GP20279@utopia.intra.guy> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1208211470 29120 80.91.229.12 (14 Apr 2008 22:17:50 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 14 Apr 2008 22:17:50 +0000 (UTC) To: supervision@list.skarnet.org Original-X-From: supervision-return-1945-gcsg-supervision=m.gmane.org@list.skarnet.org Tue Apr 15 00:18:22 2008 connect(): Connection refused Return-path: Envelope-to: gcsg-supervision@gmane.org Original-Received: from antah.skarnet.org ([212.85.147.14]) by lo.gmane.org with smtp (Exim 4.50) id 1JlX0G-0006D7-5f for gcsg-supervision@gmane.org; Tue, 15 Apr 2008 00:18:20 +0200 Original-Received: (qmail 26564 invoked by uid 76); 14 Apr 2008 22:18:01 -0000 Mailing-List: contact supervision-help@list.skarnet.org; run by ezmlm List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Archive: Original-Received: (qmail 26558 invoked from network); 14 Apr 2008 22:18:01 -0000 Mail-Followup-To: supervision@list.skarnet.org Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.11 Xref: news.gmane.org gmane.comp.sysutils.supervision.general:1710 Archived-At: * Robin Bowes [20080414 23:48]: > 3. Creates the log dir, if it does not exist, and sets permissions > > #!/bin/sh > [snip env setting] > LOG_PARENT=/var/log > > # Get the service name > logdir=`pwd` > svcdir=${logdir%/log} > SERVICE_NAME=${svcdir##*/} > > # Set LOGUSER and LOGDIR to default values if not set in ./env > : ${LOGUSER:=${LOG_PARENT}/${SERVICE_NAME}} > : ${LOGDIR:=${LOG_PARENT}/${SERVICE_NAME}} > > # Make sure the log dir exists > if [ ! -e "${LOGDIR}" ]; then > mkdir -p "${LOGDIR}" > fi > # Set ownership & permissions on the log dir > chown -R ${LOGUSER} "${LOGDIR}" > chmod 750 "${LOGDIR}" > chmod g+s "${LOGDIR}" I've been using this: #!/command/execlineb emptyenv -p multisubstitute { define SIZE s1000000 define NUM n10 define DIR ./main/ } envdir ./env/ statfile -ug ${DIR} setstate -ug multilog t ${NUM} ${SIZE} ${PROC} ${DIR} > Any thoughts? I should protect mine against a non-existant env, but I don't know how to use execline's if with statfile's env var setting; Paul, Laurent? qvb -- pica