[rancid] Location of logs directory

heasley heas at shrubbery.net
Mon Aug 15 20:49:13 UTC 2016


Sun, Aug 14, 2016 at 06:35:31PM +0000, David Jones:
> Minor update request related to $LOGDIR.
> Fresh install of 3.4.1.  I moved my logs directory in the rancid.conf:
>      LOGDIR=/usr/local/rancid/logs
> However, the logs are hard-coded to be under the $BASEDIR in bin/rancid-cvs.
> Lines 138 and 139 should be changed from:
>      # Log dir
>      if [ ! -d logs ]; then
>          mkdir logs
>      fi
> to:
>      # Log dir
>      if [ ! -d "$LOGDIR" ]; then
>          mkdir -p "$LOGDIR"
>     fi
> Thank you,
> Dave Jones
> Lead Systems Engineer
> Education Networks of America
> www.ena.com

Thanks.  I think this is thorough:

Index: CHANGES
===================================================================
--- CHANGES	(revision 3446)
+++ CHANGES	(working copy)
@@ -1,4 +1,7 @@
 3.4.99
+	rancid-cvs, rancid-run, rancid.conf: use LOGDIR from rancid.conf, set a
+	default, and makes manpage notes - David Jones
+
 	control_rancid: if the router list is empty, commit everything, not
 	just router.db.  .cvsignore, rancid.conf, etc.
 
Index: bin/rancid-cvs.in
===================================================================
--- bin/rancid-cvs.in	(revision 3446)
+++ bin/rancid-cvs.in	(working copy)
@@ -134,9 +134,11 @@
     ;;
 esac
 
-# Log dir
-if [ ! -d logs ]; then
-    mkdir logs
+# LOGDIR location
+LOGDIR=${LOGDIR:=$BASEDIR/logs};
+if [ ! -d $LOGDIR ]; then
+    mkdir -p $LOGDIR || (echo "Could not create log directory: $LOGDIR" >&2;    
+			 exit 1)
 fi
 
 # Which groups to do
Index: bin/rancid-run.in
===================================================================
--- bin/rancid-run.in	(revision 3446)
+++ bin/rancid-run.in	(working copy)
@@ -123,8 +123,11 @@
     exit 1
 fi
 
+# LOGDIR location
+LOGDIR=${LOGDIR:=$BASEDIR/logs};
 if [ ! -d $LOGDIR ] ; then
-    mkdir $LOGDIR || (echo "Could not create log directory: $LOGDIR"; exit 1)
+    mkdir -p $LOGDIR || (echo "Could not create log directory: $LOGDIR" >&2;
+			 exit 1)
 fi
 
 for GROUP in $LIST_OF_GROUPS
Index: man/rancid.conf.5.in
===================================================================
--- man/rancid.conf.5.in	(revision 3446)
+++ man/rancid.conf.5.in	(working copy)
@@ -2,7 +2,7 @@
 .\" $Id$
 .\"
 .hys 50
-.TH "rancid.conf" "5" "3 April 2016"
+.TH "rancid.conf" "5" "15 August 2016"
 .SH NAME
 rancid.conf \- rancid environment configuration file
 .SH DESCRIPTION
@@ -163,6 +163,8 @@
 Directory where
 .B rancid-run
 places log files.
+This can not be set or altered effectively in a group-specific
+.B rancid.conf.
 .sp
 Default: $BASEDIR/logs
 .\"
@@ -315,6 +317,9 @@
 .TP
 .B @sysconfdir@/rancid.conf
 Configuration file described here.
+.TP
+.B <group>/rancid.conf
+Group-specific configuration file described here.
 .El
 .\"
 .SH "SEE ALSO"



More information about the Rancid-discuss mailing list