[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
20001002: LDM facility enhancement (cont.) (fwd)
- Subject: 20001002: LDM facility enhancement (cont.) (fwd)
- Date: Tue, 3 Oct 2000 07:42:22 -0600 (MDT)
===============================================================================
Robb Kambic Unidata Program Center
Software Engineer III Univ. Corp for Atmospheric Research
address@hidden WWW: http://www.unidata.ucar.edu/
===============================================================================
---------- Forwarded message ----------
Date: Mon, 02 Oct 2000 17:22:49 -0600
From: Unidata Support <address@hidden>
To: address@hidden
Subject: 20001002: LDM facility enhancement (cont.)
------- Forwarded Message
>From: address@hidden
>Subject: Logging facility enhancement
>Organization: Oregon State University
>Keywords: 200009142249.e8EMnCb02002 LDM ldm-mcidas batch.k
Russ and company,
We just implemented the code patch to ulog.c, rebuilt ldm, reconfigured
syslog.conf, and restarted ldm. We're happy to report that ldm is working just
fine using "local1". Thanks so much. It will make future ldm upgrades much
less painful for me.
Wayne Gibson
Oregon State University
>From address@hidden Wed Sep 20 14:24 PDT 2000
To: Wayne Gibson <address@hidden>
address@hidden, address@hidden
Subject: Re: 20000919: LDM code modification change request
Date: Wed, 20 Sep 2000 15:24:30 -0600
From: Russ Rew <address@hidden>
X-Status:
X-Keywords:
X-UID: 1569
>cc: address@hidden,
>cc: address@hidden
>From: Wayne Gibson <address@hidden>
>Subject: Re: 20000919: ROUTE PostProcessing setup at Oregon State (cont.)
>Organization: Oregon State University
>Keywords: 200009142249.e8EMnCb02002 LDM ldm-mcidas batch.k
Wayne,
Please find appended a patch to ulog/ulog.c from the sources for LDM
version 5.1.2, though this should also work for version 5.0.8 since
ulog.c has not changed recently. The patch just adds a single
block of code to the openulog() function in ulog.c.
If you rebuild the LDM with this patch, it should allow you to
override the syslog facility used by the LDM, by setting the
environment variable ULOG_FACILITY_OVERRIDE. For example, to use
LOG_LOCAL1 instead of LOG_LOCAL0 for LDM programs, you would set the
environment variable as follows in the .cshrc file of the ldm user
setenv ULOG_FACILITY_OVERRIDE 1
You would also have to manually edit the scour script to replace
"local0" with "local1" and change /etc/syslog.conf to use "local1"
instead of "local0" for ldm logging. To see the change, you'd have to
stop, newlog, and start the LDM using ldmadmin.
At your convenience, if you have time to try this we'd be interested
to hear whether it works OK for you. We'll probably include it in a
future release, as well as changes to the scour script to detect and
use the environment variable too.
--Russ
_____________________________________________________________________
Russ Rew UCAR Unidata Program
address@hidden http://www.unidata.ucar.edu
===================================================================
RCS file: /upc/share/CVS/ldm5/ulog/ulog.c,v
retrieving revision 1.87
diff -c -r1.87 ulog.c
*** ulog.c 1999/04/03 01:35:52 1.87
--- ulog.c 2000/09/20 21:05:06
***************
*** 141,146 ****
--- 141,148 ----
* Always attempts to open the log connection if there is none,
* even if the LOG_NDELAY option bit is cleared.
* Returns the descriptor (socket) of the logger or -1 on system call error.
+ * If ULOG_FACILITY_OVERRIDE environment variable is set, overrides facility.
+ *
* N.B. multiple calls without an intervening 'closeulog()' simply
reinitialize
* ident, options, and facility.
* The data referred to by 'ident' and 'filename' should have process
lifetime.
***************
*** 155,160 ****
--- 157,201 ----
setulogident(ident);
logOptions = options;
+
+ /*
+ * Check the environment for overriding facility.
+ */
+ {
+ int facility_level = 0;
+ const char *ufo = getenv("ULOG_FACILITY_OVERRIDE");
+ if(ufo != NULL) {
+ facility_level = atoi(ufo);
+ switch (facility_level) {
+ case 0:
+ facility = LOG_LOCAL0;
+ break;
+ case 1:
+ facility = LOG_LOCAL1;
+ break;
+ case 2:
+ facility = LOG_LOCAL2;
+ break;
+ case 3:
+ facility = LOG_LOCAL3;
+ break;
+ case 4:
+ facility = LOG_LOCAL4;
+ break;
+ case 5:
+ facility = LOG_LOCAL5;
+ break;
+ case 6:
+ facility = LOG_LOCAL6;
+ break;
+ case 7:
+ facility = LOG_LOCAL7;
+ break;
+ default:
+ break;
+ }
+ }
+ }
if (facility != 0 && (facility &~ LOG_FACMASK) == 0)
logFacility = facility;
------------- End Forwarded Message -------------
------- End of Forwarded Message