newsyslog: add rc.d script, conf file and cron hourly job.
--HG-- extra : convert_revision : e1c49bf7bd9b281e17a885e2f972f9302390726c
This commit is contained in:
parent
f7c1a34b88
commit
105ba02e05
|
@ -0,0 +1,28 @@
|
|||
#!/bin/sh
|
||||
#
|
||||
|
||||
# PROVIDE: newsyslog
|
||||
# REQUIRE: LOGIN
|
||||
# KEYWORD: shutdown
|
||||
|
||||
$_rc_subr_loaded . /etc/rc.subr
|
||||
|
||||
name="newsyslog"
|
||||
rcvar=$name
|
||||
command="/sbin/${name}"
|
||||
required_files="/etc/newsyslog.conf"
|
||||
start_cmd="newsyslog_start"
|
||||
stop_cmd=":"
|
||||
|
||||
newsyslog_start()
|
||||
{
|
||||
# Use bzip2 compression by default.
|
||||
[ -z "${newsyslog_flags}" ] && newsyslog_flags="-b"
|
||||
|
||||
echo -n "Trimming log files: "
|
||||
${command} ${newsyslog_flags}
|
||||
echo "done."
|
||||
}
|
||||
|
||||
load_rc_config $name
|
||||
run_rc_command "$1"
|
|
@ -0,0 +1,30 @@
|
|||
# Common variables
|
||||
set prevlog = /var/log/%n-%d
|
||||
|
||||
syslog {
|
||||
###############################################################
|
||||
# Name Location Owner Group Perms
|
||||
###############################################################
|
||||
log: auth /var/log/auth.log root root 644
|
||||
log: daemon /var/log/daemon.log root root 644
|
||||
log: dmesg /var/log/dmesg.log root root 644
|
||||
log: kern /var/log/kern.log root root 644
|
||||
log: lastlog /var/log/lastlog root root 644
|
||||
log: mail /var/log/mail.log root root 644
|
||||
log: sys /var/log/sys.log root root 644
|
||||
log: user /var/log/user.log root root 644
|
||||
log: wtmp /var/log/wtmp root root 644
|
||||
|
||||
################################################
|
||||
# Name Archive Count
|
||||
################################################
|
||||
archive: auth prevlog 10
|
||||
archive: daemon prevlog 10
|
||||
archive: dmesg prevlog 10
|
||||
archive: kern prevlog 10
|
||||
archive: lastlog prevlog 10
|
||||
archive: mail prevlog 10
|
||||
archive: sys prevlog 10
|
||||
archive: user prevlog 10
|
||||
archive: wtmp prevlog 10
|
||||
}
|
|
@ -0,0 +1,5 @@
|
|||
#!/bin/sh
|
||||
#
|
||||
# Run newsyslog every hour.
|
||||
|
||||
/sbin/newsyslog -b
|
|
@ -1,6 +1,7 @@
|
|||
# Template file for 'newsyslog'
|
||||
pkgname=newsyslog
|
||||
version=1.8
|
||||
revision=1
|
||||
distfiles="http://archives.eyrie.org/software/system/$pkgname-$version.tar.gz"
|
||||
build_style=gnu_configure
|
||||
configure_args="--sbindir=/sbin"
|
||||
|
@ -15,6 +16,17 @@ long_desc="
|
|||
rotation to handle stopping, restarting, or sending signals to servers,
|
||||
and it automatically compresses logs when it archives them."
|
||||
|
||||
conf_files="/etc/newsyslog.conf"
|
||||
|
||||
Add_dependency full glibc
|
||||
Add_dependency full zlib
|
||||
Add_dependency full bzip2
|
||||
|
||||
post_install()
|
||||
{
|
||||
install -D -m755 ${FILESDIR}/newsyslog ${DESTDIR}/etc/rc.d/newsyslog
|
||||
install -D -m644 ${FILESDIR}/newsyslog.conf \
|
||||
${DESTDIR}/etc/newsyslog.conf
|
||||
install -D -m744 ${FILESDIR}/newsyslog.cron-hourly \
|
||||
${DESTDIR}/etc/cron.hourly/newsyslog
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue