[evlog-dev] [Patch] 1.5.3: Evlog SysV init script

"O'Riordain, Seosamh" <[email protected]> Wed, 5 Nov 2003 11:07:39 -0000
Newsgroups gmane.linux.kernel.event-logging
Message-ID <0CA17FFA5554E4439FC308750A6661E505C6A787@iloexc01.emea.cpqcorp.net>
This is a multi-part message in MIME format.

------_=_NextPart_001_01C3A38D.067CFCD0
Content-Type: text/plain;
	charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

Hi,

I've attached a simple patch for the evlog init script that I've found
useful.
It basically enables it read startup options for the evlog daemon from
/etc/sysconfig/evlog. This file can contain a line with the command line
options=20
specified inside the EVLOGD_OPTIONS variable.
This is similar in behaviour to other subsystems (eg syslog).=20
For example, if one only needs to send logs to a remote
host and not to local files, one could add the -u option to this file
and then
do a restart (i.e EVLOGD_OPTIONS=3D"-u").
Basically it means that one would not have to modify the init=20
script itself.

Regards,
Seo

*** evlog.orig	Wed Nov  5 09:31:07 2003
--- evlog	Wed Nov  5 09:32:12 2003
***************
*** 17,22 ****
--- 17,27 ----
 =20
  [ -f /sbin/evlogd ] || exit 0
 =20
+ # Source config
+ EVLOGD_OPTIONS=3D""
+ if [ -f /etc/sysconfig/evlog ] ; then
+         . /etc/sysconfig/evlog
+ fi
 =20
  RETVAL=3D0
 =20
***************
*** 36,44 ****
   =09
   	if [ ! -z "$REDHAT" ]
  	then =09
! 		daemon /sbin/evlogd
  	else
! 		/sbin/evlogd
  	fi
  	sleep 1
  	RETVAL=3D$?
--- 41,49 ----
   =09
   	if [ ! -z "$REDHAT" ]
  	then =09
! 		daemon /sbin/evlogd $EVLOGD_OPTIONS
  	else
! 		/sbin/evlogd $EVLOGD_OPTIONS
  	fi
  	sleep 1
  	RETVAL=3D$?


------_=_NextPart_001_01C3A38D.067CFCD0
Content-Type: text/html;
	charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; =
charset=3Dus-ascii">
<META NAME=3D"Generator" CONTENT=3D"MS Exchange Server version =
6.0.6396.0">
<TITLE>[Patch] 1.5.3: Evlog SysV init script</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/rtf format -->

<P><FONT SIZE=3D2 FACE=3D"Arial">Hi,</FONT>
</P>

<P><FONT SIZE=3D2 FACE=3D"Arial">I've attached a simple patch for the =
evlog init script that I've found useful.</FONT>

<BR><FONT SIZE=3D2 FACE=3D"Arial">It basically enables it read startup =
options for the evlog daemon from</FONT>

<BR><FONT SIZE=3D2 FACE=3D"Arial">/etc/sysconfig/evlog. This file can =
contain a line with the command line options </FONT>

<BR><FONT SIZE=3D2 FACE=3D"Arial">specified inside the EVLOGD_OPTIONS =
variable.</FONT>

<BR><FONT SIZE=3D2 FACE=3D"Arial">This is similar in behaviour to other =
subsystems (eg syslog). </FONT>

<BR><FONT SIZE=3D2 FACE=3D"Arial">For example, if one only needs to send =
logs to a remote</FONT>

<BR><FONT SIZE=3D2 FACE=3D"Arial">host and not to local files, one could =
add the -u option to this file and then</FONT>

<BR><FONT SIZE=3D2 FACE=3D"Arial">do a restart (i.e =
EVLOGD_OPTIONS=3D&quot;-u&quot;).</FONT>

<BR><FONT SIZE=3D2 FACE=3D"Arial">Basically it means that one would not =
have to modify the init </FONT>

<BR><FONT SIZE=3D2 FACE=3D"Arial">script itself.</FONT>
</P>

<P><FONT SIZE=3D2 FACE=3D"Arial">Regards,</FONT>

<BR><FONT SIZE=3D2 FACE=3D"Arial">Seo</FONT>
</P>

<P><FONT SIZE=3D2 FACE=3D"Arial">*** evlog.orig&nbsp; Wed Nov&nbsp; 5 =
09:31:07 2003</FONT>

<BR><FONT SIZE=3D2 FACE=3D"Arial">--- =
evlog&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Wed Nov&nbsp; 5 09:32:12 =
2003</FONT>

<BR><FONT SIZE=3D2 FACE=3D"Arial">***************</FONT>

<BR><FONT SIZE=3D2 FACE=3D"Arial">*** 17,22 ****</FONT>

<BR><FONT SIZE=3D2 FACE=3D"Arial">--- 17,27 ----</FONT>

<BR><FONT SIZE=3D2 FACE=3D"Arial">&nbsp; </FONT>

<BR><FONT SIZE=3D2 FACE=3D"Arial">&nbsp; [ -f /sbin/evlogd ] || exit =
0</FONT>

<BR><FONT SIZE=3D2 FACE=3D"Arial">&nbsp; </FONT>

<BR><FONT SIZE=3D2 FACE=3D"Arial">+ # Source config</FONT>

<BR><FONT SIZE=3D2 FACE=3D"Arial">+ EVLOGD_OPTIONS=3D&quot;&quot;</FONT>

<BR><FONT SIZE=3D2 FACE=3D"Arial">+ if [ -f /etc/sysconfig/evlog ] ; =
then</FONT>

<BR><FONT SIZE=3D2 =
FACE=3D"Arial">+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; . =
/etc/sysconfig/evlog</FONT>

<BR><FONT SIZE=3D2 FACE=3D"Arial">+ fi</FONT>

<BR><FONT SIZE=3D2 FACE=3D"Arial">&nbsp; </FONT>

<BR><FONT SIZE=3D2 FACE=3D"Arial">&nbsp; RETVAL=3D0</FONT>

<BR><FONT SIZE=3D2 FACE=3D"Arial">&nbsp; </FONT>

<BR><FONT SIZE=3D2 FACE=3D"Arial">***************</FONT>

<BR><FONT SIZE=3D2 FACE=3D"Arial">*** 36,44 ****</FONT>

<BR><FONT SIZE=3D2 FACE=3D"Arial">&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; =
</FONT>

<BR><FONT SIZE=3D2 FACE=3D"Arial">&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; =
if [ ! -z &quot;$REDHAT&quot; ]</FONT>

<BR><FONT SIZE=3D2 FACE=3D"Arial">&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
then &nbsp;&nbsp; </FONT>

<BR><FONT SIZE=3D2 FACE=3D"Arial">! &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; daemon /sbin/evlogd</FONT>

<BR><FONT SIZE=3D2 FACE=3D"Arial">&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
else</FONT>

<BR><FONT SIZE=3D2 FACE=3D"Arial">! &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /sbin/evlogd</FONT>

<BR><FONT SIZE=3D2 FACE=3D"Arial">&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
fi</FONT>

<BR><FONT SIZE=3D2 FACE=3D"Arial">&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
sleep 1</FONT>

<BR><FONT SIZE=3D2 FACE=3D"Arial">&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
RETVAL=3D$?</FONT>

<BR><FONT SIZE=3D2 FACE=3D"Arial">--- 41,49 ----</FONT>

<BR><FONT SIZE=3D2 FACE=3D"Arial">&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; =
</FONT>

<BR><FONT SIZE=3D2 FACE=3D"Arial">&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; =
if [ ! -z &quot;$REDHAT&quot; ]</FONT>

<BR><FONT SIZE=3D2 FACE=3D"Arial">&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
then &nbsp;&nbsp; </FONT>

<BR><FONT SIZE=3D2 FACE=3D"Arial">! &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; daemon /sbin/evlogd =
$EVLOGD_OPTIONS</FONT>

<BR><FONT SIZE=3D2 FACE=3D"Arial">&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
else</FONT>

<BR><FONT SIZE=3D2 FACE=3D"Arial">! &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /sbin/evlogd =
$EVLOGD_OPTIONS</FONT>

<BR><FONT SIZE=3D2 FACE=3D"Arial">&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
fi</FONT>

<BR><FONT SIZE=3D2 FACE=3D"Arial">&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
sleep 1</FONT>

<BR><FONT SIZE=3D2 FACE=3D"Arial">&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
RETVAL=3D$?</FONT>
</P>

</BODY>
</HTML>
------_=_NextPart_001_01C3A38D.067CFCD0--


-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
Does SourceForge.net help you be more productive?  Does it
help you create better code?   SHARE THE LOVE, and help us help
YOU!  Click Here: http://sourceforge.net/donate/