Thank you for replying.
For a few days I read the source code for understanding the behaviour
to write logs. And I got some questions.
0. Obviously the comment on ha.cf sample file is incorrect and
attached the patch file.(ha.cf.fix_comment.patch)
1. Maybe many people set not to write to system logs, because
heartbeat earns so many logs with logfacility none. I feel that it is
better that the default behaviour is not writing to system logs and
writing other files.
2. In spite of not using ha_logd, Heartbeat init script boot up it.
And ha_logd configuration file place is fixed. So, I add the
function.(ha_logd.init.patch)
Best Regards
MATSUDA, Daiki
2008/1/24, Andrew Beekhof <[EMAIL PROTECTED]>:
>
> On Jan 24, 2008, at 12:50 AM, DAIKI MATSUDA wrote:
>
> > Hi, Linux-HA developers all.
> >
> > I posted to linux-ha ML
> > (http://www.gossamer-threads.com/lists/linuxha/users/45268), but
> > because almost reply does not returned, I will post to here again.
> >
> > In ha.cf sample in /usr/share/doc/heartbeat-2.1.3 it is written in
> > the following
> > # Note on logging:
> > # If any of debugfile, logfile and logfacility are defined then they
> > # will be used. If debugfile and/or logfile are not defined and
> > # logfacility is defined then the respective logging and debug
> > # messages will be loged to syslog. If logfacility is not defined
> > # then debugfile and logfile will be used to log messges. If
> > # logfacility is not defined and debugfile and/or logfile are not
> > # defined then defaults will be used for debugfile and logfile as
> > # required and messages will be sent there.
> >
> > Though I set the configs to
> > logfile /var/log/ha-log
> > debugfile /var/log/ha-debug
> > #logfacility local0
> > , the Heartbeat writes the logs to system log file.
> >
> > Is it the feature to always write logs to system log? I think that it
> > is the bug and feel better to behave to write to only indicated file
> > such as apache.
>
> IIRC, the only way to turn off syslog logging is with:
>
> logfacility none
>
> _______________________________________________________
> Linux-HA-Dev: [email protected]
> http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
> Home Page: http://linux-ha.org/
>
--- Heartbeat-Dev-3aa6bea6a251/heartbeat/init.d/heartbeat.in 2008-01-30 10:01:16.000000000 +0900
+++ Heartbeat-Dev-3aa6bea6a251/heartbeat/init.d/heartbeat.in.new 2008-01-30 10:07:12.000000000 +0900
@@ -44,6 +44,11 @@
# Default-Stop: 0 1 6
### END INIT INFO
+[ -f /etc/sysconfig/heartbeat ] && . /etc/sysconfig/heartbeat
+
+: ${USE_LOGD=yes}
+LOGD_OPT=""
+[ -n "$LOGD_CFG" ] && LOGD_OPT="$LOGD_OPT -c $LOGD_CFG"
[EMAIL PROTECTED]@/ha.d; export HA_DIR
CONFIG=$HA_DIR/ha.cf
@@ -161,7 +166,7 @@
fi
- $HA_BIN/ha_logd -d >/dev/null 2>&1
+ $HA_BIN/ha_logd -d $LOGD_OPT >/dev/null 2>&1
if
[ $? -ne 0 ]
then
@@ -432,7 +437,7 @@
case "$1" in
start)
- StartLogd
+ [ "$USE_LOGD" = "yes" ] && StartLogd
RunStartStop pre-start
StartHA
RC=$?
@@ -465,7 +470,7 @@
rm -f $LOCKDIR/$SUBSYS
fi
RunStartStop post-stop $RC
- StopLogd
+ [ "$USE_LOGD" = "yes" ] && StopLogd
;;
restart)
--- Heartbeat-Dev-0441584bfdd7/doc/ha.cf.orig 2008-01-31 14:32:57.000000000 +0900
+++ Heartbeat-Dev-0441584bfdd7/doc/ha.cf 2008-01-31 14:38:35.000000000 +0900
@@ -15,14 +15,10 @@
#
#
# Note on logging:
-# If any of debugfile, logfile and logfacility are defined then they
-# will be used. If debugfile and/or logfile are not defined and
-# logfacility is defined then the respective logging and debug
-# messages will be loged to syslog. If logfacility is not defined
-# then debugfile and logfile will be used to log messges. If
-# logfacility is not defined and debugfile and/or logfile are not
-# defined then defaults will be used for debugfile and logfile as
-# required and messages will be sent there.
+# If all of debugfile, logfile and logfacility are not defined,
+# logging is the same as use_logd yes. In other case, they are
+# respectively effective. if detering the logging to syslog,
+# logfacility must be "none".
#
# File to write debug messages to
#debugfile /var/log/ha-debug
_______________________________________________________
Linux-HA-Dev: [email protected]
http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
Home Page: http://linux-ha.org/