From ff7a7a9c33ca8787493e8e668f12a6599e1b6858 Mon Sep 17 00:00:00 2001 From: Juan RP Date: Sun, 29 Mar 2009 16:07:41 +0200 Subject: [PATCH] metalog: add rc.d script and config file. --HG-- extra : convert_revision : b861369fc6e0c839f160fd74b2ef1dd8c2f1eb35 --- templates/metalog/files/metalog | 17 +++++++ templates/metalog/files/metalog.conf | 68 ++++++++++++++++++++++++++++ templates/metalog/template | 8 ++++ 3 files changed, 93 insertions(+) create mode 100644 templates/metalog/files/metalog create mode 100644 templates/metalog/files/metalog.conf diff --git a/templates/metalog/files/metalog b/templates/metalog/files/metalog new file mode 100644 index 0000000000..17e5593422 --- /dev/null +++ b/templates/metalog/files/metalog @@ -0,0 +1,17 @@ +#!/bin/sh +# +# PROVIDE: metalog +# REQUIRE: SERVERS +# BEFORE: random_seed + +$_rc_subr_loaded . /etc/rc.subr + +name="metalog" +rcvar=$name +command="/usr/sbin/$name" +command_args="--daemonize" +required_files="/etc/metalog.conf" +pidfile="/var/run/$name.pid" + +load_rc_config $name +run_rc_command "$1" diff --git a/templates/metalog/files/metalog.conf b/templates/metalog/files/metalog.conf new file mode 100644 index 0000000000..96e10471d2 --- /dev/null +++ b/templates/metalog/files/metalog.conf @@ -0,0 +1,68 @@ +# Sample Metalog configuration file + +maxsize = 1048576 # size in bytes (1048576 = 1 megabyte) +maxtime = 86400 # time in seconds (86400 = 1 day) +maxfiles = 10 # num files per directory + +# This will capture all of the internal log messages that metalog itself +# generates. If you use any "command" options below, you will want this +# as metalog generates a lot of status messages whenever it executes a +# command and children processes exit. + +Metalog : + + program = "metalog" + logdir = "/var/log/metalog" + break = 1 + +Authentication : + + facility = "auth" + facility = "authpriv" + logdir = "/var/log/auth" + break = 1 + +Critical : + + facility = "*" + minimum = 1 + logdir = "/var/log/critical" + break = 1 + +Password failures : + + regex = "(password|login|authentication)\s+(fail|invalid)" + regex = "(failed|invalid)\s+(password|login|authentication|user)" + regex = "ILLEGAL ROOT LOGIN" + logdir = "/var/log/pwdfail" + break = 1 + +Kernel messages : + + facility = "kern" + logdir = "/var/log/kernel" + break = 1 + +Daemons : + facility = "daemon" + logdir = "/var/log/daemon" + break = 1 + +crond : + + facility = "cron" + logdir = "/var/log/cron" + break = 1 + +SSH Server : + + program = "sshd" + logdir = "/var/log/sshd" + break = 1 + +Mail : + + facility = "mail" + neg_regex= "starting daemon" + logdir = "/var/log/mail" + break = 1 diff --git a/templates/metalog/template b/templates/metalog/template index 67277a4636..25b5f7bc29 100644 --- a/templates/metalog/template +++ b/templates/metalog/template @@ -16,4 +16,12 @@ conf_files="/etc/metalog.conf" Add_dependency full glibc Add_dependency full pcre +Add_dependency full bzip2 Add_dependency build lzma-utils + +post_install() +{ + install -d ${DESTDIR}/etc/rc.d + install -m755 ${FILESDIR}/metalog ${DESTDIR}/etc/rc.d + install -m644 ${FILESDIR}/metalog.conf ${DESTDIR}/etc +}