metalog: switch to OpenRC; bump revision.

--HG--
extra : convert_revision : ba3f40d2cebc31821587c1e018529437706e2d17
This commit is contained in:
Juan RP 2009-05-04 21:59:21 +02:00
parent 4e869cddf8
commit 8b045bed29
5 changed files with 71 additions and 19 deletions

20
templates/metalog/INSTALL Normal file
View File

@ -0,0 +1,20 @@
#
# This script registers the metalog service into the
# 'default' runlevel, as required by OpenRC.
#
case "${ACTION}" in
pre)
;;
post)
[ ! -x sbin/rc-update ] && exit 0
[ ! -x sbin/rc-service ] && exit 0
if sbin/rc-service -e udev; then
echo "Registering ${PKGNAME} OpenRC service..."
sbin/rc-update add ${PKGNAME} default
[ $? -ne 0 ] && exit $?
sbin/rc-update -u
fi
;;
esac

20
templates/metalog/REMOVE Normal file
View File

@ -0,0 +1,20 @@
#
# This script unregisters the metalog service from the
# 'default' runlevel, as required by OpenRC.
#
case "${ACTION}" in
pre)
[ ! -x sbin/rc-update ] && exit 0
[ ! -x sbin/rc-service ] && exit 0
if sbin/rc-service -e udev; then
echo "Unregistering ${PKGNAME} OpenRC service..."
sbin/rc-update del ${PKGNAME} default
[ $? -ne 0 ] && exit $?
sbin/rc-update -u
fi
;;
post)
;;
esac

View File

@ -1,17 +0,0 @@
#!/bin/sh
#
# PROVIDE: metalog
# REQUIRE: SERVERS
# BEFORE: locale
$_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"

View File

@ -0,0 +1,28 @@
#!/sbin/runscript
extra_commands="buffer unbuffer"
command=/usr/sbin/metalog
pidfile=${metalog_pid:-/var/run/metalog.pid}
command_args="$metalog_flags --daemonize --pidfile $pidfile"
depend()
{
provide logger
need localmount
use clock hostname
after bootmisc
}
buffer()
{
ebegin "Enabling log buffering"
start-stop-daemon --signal USR2 --pidfile $pidfile
eend $?
}
unbuffer()
{
ebegin "Disabling log buffering"
start-stop-daemon --signal USR1 --pidfile $pidfile
eend $?
}

View File

@ -1,6 +1,7 @@
# Template file for 'metalog'
pkgname=metalog
version=1
revision=1
distfiles="${SOURCEFORGE_SITE}/$pkgname/$pkgname-$version.tar.lzma"
build_style=gnu_configure
configure_args="--with-unicode"
@ -21,7 +22,7 @@ Add_dependency build lzma-utils
post_install()
{
install -d ${DESTDIR}/etc/rc.d
install -m755 ${FILESDIR}/metalog ${DESTDIR}/etc/rc.d
install -d ${DESTDIR}/etc/init.d
install -m755 ${FILESDIR}/metalog.rc ${DESTDIR}/etc/init.d/metalog
install -m644 ${FILESDIR}/metalog.conf ${DESTDIR}/etc
}