From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.sysutils.supervision.general/1712 Path: news.gmane.org!not-for-mail From: Robin Bowes Newsgroups: gmane.comp.sysutils.supervision.general Subject: Re: Help with chpst -e Date: Tue, 15 Apr 2008 00:05:02 +0100 Message-ID: References: <20080414083428.GK20279@utopia.intra.guy> <20080414164126.GP20279@utopia.intra.guy> <20080414221821.GV20279@utopia.intra.guy> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-2; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1208214359 5776 80.91.229.12 (14 Apr 2008 23:05:59 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 14 Apr 2008 23:05:59 +0000 (UTC) To: supervision@list.skarnet.org Original-X-From: supervision-return-1947-gcsg-supervision=m.gmane.org@list.skarnet.org Tue Apr 15 01:06:17 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 1JlXkC-0003A1-5G for gcsg-supervision@gmane.org; Tue, 15 Apr 2008 01:05:52 +0200 Original-Received: (qmail 385 invoked by uid 76); 14 Apr 2008 23:05:29 -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 379 invoked from network); 14 Apr 2008 23:05:29 -0000 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 60 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: 84-51-160-74.pambow882.adsl.metronet.co.uk User-Agent: Thunderbird 2.0.0.12 (X11/20080226) In-Reply-To: <20080414221821.GV20279@utopia.intra.guy> X-Enigmail-Version: 0.95.6 Original-Sender: news Xref: news.gmane.org gmane.comp.sysutils.supervision.general:1712 Archived-At: Andras Korn wrote: > This is more "Debianish" in that it gets the configuration from > /etc/default/svlogd, possibly overridden by /etc/default/name-of-service. > These files can override the svlogd config as well (e.g. set a different > postprocessor or retention policy). That's an idea. I may incorporate that (I'm using RH-flavours). > I keep /var/log/sv on a separate volume from /var/log because not everything > logs via svlogd and /var/log might be filled. OK. > As for your script, some comments: > >> # Get the service name >> logdir=`pwd` >> svcdir=${logdir%/log} >> SERVICE_NAME=${svcdir##*/} > > Isn't this a bashism? Yes. I welcome suggestions how to do this in a more portable way. >> # Set LOGUSER and LOGDIR to default values if not set in ./env >> : ${LOGUSER:=${LOG_PARENT}/${SERVICE_NAME}} >> : ${LOGDIR:=${LOG_PARENT}/${SERVICE_NAME}} > > You could use LOGDIR=${LOGDIR:-$LOG_PARENT/$SERVICE_NAME} for no real > benefit. Yes, indeed. > Setting LOGUSER to the name of a directory is probably a > copy-paste mistake, I guess? :) No, it's based on the premise that each service is run by a user with the same name. This is over-ridden by the contents of ./env/LOGUSER >> # Make sure the log dir exists >> if [ ! -e "${LOGDIR}" ]; then >> mkdir -p "${LOGDIR}" >> fi > > This fails if LOGDIR exists but is not a directory. (Of course, that > shouldn't happen.) True. I could use -d, but then do I test for $LOGDIR existing but not being a directory? One has to stop somewhere...! >> # Set ownership & permissions on the log dir >> chown -R ${LOGUSER} "${LOGDIR}" > > This gives ownership of the config file, if it exists, to svlogd. I don't > think that's good. No, it gives ownership of the logdir to the user running the log process so it can write to that dir. R.