You are not logged in.

#1 2003-12-30 14:39:50

Jagged
Member
From: Blacksburg, VA
Registered: 2003-07-18
Posts: 153

If you want to use metalog instead of syslog and klog...

You need these two files (if the maintainer of the metalog package could add these to the package, that would be most excellent).

/etc/rc.d/metalog
#!/bin/bash

. /etc/rc.conf
. /etc/rc.d/functions

PID=`pidof -o %PPID /usr/sbin/metalog`
case "$1" in
  start)
    stat_busy "Starting Metalog Daemon"
    [ -z "$PID" ] && /usr/sbin/metalog --sync --daemonize >>/var/log/metalog 2>&
1
    if [ $? -gt 0 ]; then
      stat_fail
    else
      echo $PID > /var/run/metalog.pid
      add_daemon metalog
      stat_done
    fi
    ;;
  stop)
    stat_busy "Stopping Metalog Daemon"
    [ ! -z "$PID" ]  && kill $PID &>/dev/null
    if [ $? -gt 0 ]; then
      stat_fail
    else
      rm_daemon metalog
      stat_done
    fi
    ;;
  restart)
    $0 stop
    $0 start
    ;;
  *)
    echo "usage: $0 {start|stop|restart}"  
esac
exit 0

And this one too:

/etc/metalog.conf
#/etc/metalog.conf

maxsize = 400000
maxtime = 86400
maxfiles = 15

Kernel messages :
        facility = "kern"
        logdir = "/var/log/kernel"

Authorisation messages :
        facility = "auth"
        facility = "authpriv"
        logdir = "/var/log/auth"

Daemon messages :
        facility = "daemon"
        logdir = "/var/log/daemon"

FTP, mail, news :
        facility = "ftp"
        facility = "mail"
        facility = "news"
        logdir = "/var/log/ftp-mail-news"

Printing :
        facility = "lpr"
        logdir = "/var/log/printer"

Security :
        facility = "security"
        logdir = "/var/log/security"

System :
        facility = "syslog"
        logdir = "/var/log/syslog"

Serious stuff :
        facility = "*"
        minimum = 2
        logdir = "/var/log/critical"

And before you go to start metalog, don't forget to /etc/rc.d/sysklogd stop.  You'll also need to mkdir any dirs you set up in /etc/metalog.conf


Nkawtg...n!

Offline

Board footer

Powered by FluxBB