summaryrefslogtreecommitdiffstats
path: root/testing
diff options
context:
space:
mode:
authorIT Offshore <developer@it-offshore.co.uk>2013-11-10 09:59:00 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2013-11-15 15:56:53 +0000
commitfb2496e8e08eec0708272fa1fd13bf0174250b95 (patch)
tree9e2ae87bd03d9662fa591d7cf2b963fd39f34eb5 /testing
parenteadf0256139ab6119be9dcc04df58ac4bef2918a (diff)
downloadaports-fb2496e8e08eec0708272fa1fd13bf0174250b95.tar.bz2
aports-fb2496e8e08eec0708272fa1fd13bf0174250b95.tar.xz
testing/inetutils-syslogd: new aport
A small syslogd for logging to multiple files http://www.gnu.org/software/inetutils/ revised complete patch for inetutils-syslogd. post-install - just gives status / info message - configuration is now done by /sbin/setup-inetutils-syslogd. Both scripts now use the system colours $STRONG $RED $GREEN. post-deinstall - just adds back busybox syslog to boot runlevel & shows the status of syslog & cron (as cron will be stopped by removing any syslog)
Diffstat (limited to 'testing')
-rw-r--r--testing/inetutils-syslogd/APKBUILD90
-rw-r--r--testing/inetutils-syslogd/inetutils-syslogd.confd9
-rw-r--r--testing/inetutils-syslogd/inetutils-syslogd.initd50
-rw-r--r--testing/inetutils-syslogd/inetutils-syslogd.logrotate38
-rw-r--r--testing/inetutils-syslogd/inetutils-syslogd.post-deinstall7
-rw-r--r--testing/inetutils-syslogd/inetutils-syslogd.post-install13
-rw-r--r--testing/inetutils-syslogd/inetutils-syslogd.setup28
-rw-r--r--testing/inetutils-syslogd/syslog.conf38
8 files changed, 273 insertions, 0 deletions
diff --git a/testing/inetutils-syslogd/APKBUILD b/testing/inetutils-syslogd/APKBUILD
new file mode 100644
index 000000000..f29cd33b8
--- /dev/null
+++ b/testing/inetutils-syslogd/APKBUILD
@@ -0,0 +1,90 @@
+# Contributor: IT Offshore <developer@it-offshore.co.uk>
+# Maintainer:
+pkgname=inetutils-syslogd
+_pkgname=inetutils
+pkgver=1.9.1
+pkgrel=0
+pkgdesc="A small syslogd for logging to multiple files"
+url="http://www.gnu.org/software/inetutils/"
+arch="all"
+license="GPL3"
+depends=""
+depends_dev=""
+makedepends="$depends_dev readline-dev ncurses-dev"
+install="$pkgname.post-install $pkgname.post-deinstall"
+subpackages="$pkgname-doc"
+source="http://ftp.gnu.org/gnu/inetutils/${_pkgname}-${pkgver}.tar.gz
+ inetutils-syslogd.initd
+ inetutils-syslogd.confd
+ syslog.conf
+ inetutils-syslogd.logrotate
+ "
+
+_builddir="$srcdir"/$_pkgname-$pkgver
+
+build() {
+ cd "$_builddir"
+
+ ./configure \
+ --build=$CBUILD \
+ --host=$CHOST \
+ --prefix=/usr \
+ --libexec=/usr/sbin \
+ --sysconfdir=/etc \
+ --mandir=/usr/share/man \
+ --infodir=/usr/share/info \
+ --localstatedir=/var \
+ --without-wrap --without-pam \
+ --disable-ftp --disable-ftpd \
+ --disable-telnet --disable-telnetd \
+ --disable-talk --disable-talkd \
+ --disable-rlogin --disable-rlogind \
+ --disable-rsh --disable-rshd \
+ --disable-rexec --disable-rexecd \
+ --disable-rcp --disable-hostname \
+ --disable-tftp --disable-tftpd \
+ --disable-ping --disable-ping6 \
+ --disable-logger --enable-syslogd \
+ --disable-inetd --disable-whois \
+ --disable-uucpd --disable-ifconfig --disable-traceroute \
+ || return 1
+ make || return 1
+}
+
+check() {
+ cd "$srcdir/${_pkgname}-${pkgver}"
+ make check
+}
+
+package() {
+ cd "$_builddir"
+ make DESTDIR="${pkgdir}" install
+ #binary installed to /usr/sbin not bin
+ rm -rf $pkgdir/usr/bin
+
+ #install init script & config defaults
+ install -m755 -D "$srcdir"/$pkgname.initd \
+ "$pkgdir"/etc/init.d/$pkgname || return 1
+ install -m644 -D "$srcdir"/$pkgname.confd \
+ "$pkgdir"/etc/conf.d/$pkgname || return 1
+ install -m644 -D "$srcdir"/syslog.conf \
+ "$pkgdir"/etc/syslog.conf || return 1
+ install -m644 -D "$srcdir"/inetutils-syslogd.logrotate \
+ "$pkgdir"/etc/logrotate.d/inetutils-syslogd || return 1
+}
+
+md5sums="944f7196a2b3dba2d400e9088576000c inetutils-1.9.1.tar.gz
+6f0deb2a07439638161d03fd887d4fad inetutils-syslogd.initd
+edf3f502d9f2bf49c5da8cb37a927d06 inetutils-syslogd.confd
+506560780445d5a7b30e2e3c96efa19d syslog.conf
+9980ae54a3791c7f9d1d3baa04698e2a inetutils-syslogd.logrotate"
+sha256sums="02a9ebde8a198cb85f87545b9d88fb103a183958139864a85fe9e027ad79ff2b inetutils-1.9.1.tar.gz
+1cf71f3656dceba3ddf0543a43a98e644a0b42999ba80b9f72318ee578c9ff53 inetutils-syslogd.initd
+86105f0a0105f50275f7381b5d7fe603b8d854a0e6753c2f06f6d0c234562948 inetutils-syslogd.confd
+a991140072f0ff1a0d3b3e593eb5935fcca0c00f93436022b9055c7450decdf9 syslog.conf
+2b3e73b1a808cabd54dd3c3b78573cdf759422fa3c7b64f15838ce0830edaa31 inetutils-syslogd.logrotate"
+sha512sums="69267bfa3cae34f6145caad668dc2e9385701fb52a144640e9893fa7f0b7694eacd1fe579de3fb7190e8485b26c00337ded136488694c399b0fc290f7eec303c inetutils-1.9.1.tar.gz
+e70d0e244fcc30e94f846b82b4ec7318b5582f512bd715fb5bd9178d7be5ede0e5b53e29431a2db5177ce2f31fc306900b3a1297a658e84b2671f3ad5153b81c inetutils-syslogd.initd
+82968692b4fe79706aacaeb1021b343288dc4f1d86925481796dac1f743a8269976ce86bf446cd0c16d246b918e5822e312660b201407eb7031a17cb398c9513 inetutils-syslogd.confd
+5abb2a0309c9e180d7cacf97917044a8d3573fdf4d5902d757788fb687800900b47a02c6ec4a113475931176b52a1c2ba0771452bfb301a11b5aa0230377872d syslog.conf
+30741cf17a86a0bf39404882711d827e200a2d22cdba873e49f1a871f8d113cfe5bb1ddf3206c44be888be15aa09104656f9bd26406abb42c9b6fed0624d0bfb inetutils-syslogd.logrotate"
diff --git a/testing/inetutils-syslogd/inetutils-syslogd.confd b/testing/inetutils-syslogd/inetutils-syslogd.confd
new file mode 100644
index 000000000..dfcc1cb85
--- /dev/null
+++ b/testing/inetutils-syslogd/inetutils-syslogd.confd
@@ -0,0 +1,9 @@
+#
+# inetutils syslogd defaults
+#
+
+# Internet connections are enabled if forwarding (which is the default).
+# Example option to add a socket for chroot jailed openvpn server
+#SYSLOGD_OPTS="--no-forward -a /etc/openvpn/jail/dev/log"
+
+SYSLOGD_OPTS="--no-forward"
diff --git a/testing/inetutils-syslogd/inetutils-syslogd.initd b/testing/inetutils-syslogd/inetutils-syslogd.initd
new file mode 100644
index 000000000..6baad86dd
--- /dev/null
+++ b/testing/inetutils-syslogd/inetutils-syslogd.initd
@@ -0,0 +1,50 @@
+#!/sbin/runscript
+
+# This file is part of inetutils-syslogd
+# Created for Alpine Linux by IT Offshore <developer@it-offshore.co.uk>
+
+name=syslogd
+daemon=/usr/sbin/$name
+config_file="/etc/syslog.conf"
+
+depend() {
+ need clock hostname localmount
+ provide logger
+}
+
+check_config() {
+ [ -f "$config_file" ] || error "$config_file is missing"
+}
+
+start_pre() {
+ check_config || return 1
+}
+
+start() {
+ ebegin "Starting ${name}"
+ start-stop-daemon --start --quiet \
+ --pidfile /var/run/${name}.pid \
+ --exec ${daemon} -- ${SYSLOGD_OPTS}
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping ${name}"
+ start-stop-daemon --stop --quiet \
+ --pidfile /var/run/$name.pid \
+ --exec ${daemon}
+ eend $?
+}
+
+reload() {
+ if [ ! -f "${PIDFILE}" ]; then
+ eerror "rsyslogd not running"
+ return 1
+ fi
+
+ ebegin "Re-opening intetutils-syslogd log files"
+ start-stop-daemon --stop --signal HUP \
+ --pidfile /var/run/$name.pid
+ eend $?
+}
+
diff --git a/testing/inetutils-syslogd/inetutils-syslogd.logrotate b/testing/inetutils-syslogd/inetutils-syslogd.logrotate
new file mode 100644
index 000000000..9edb145f6
--- /dev/null
+++ b/testing/inetutils-syslogd/inetutils-syslogd.logrotate
@@ -0,0 +1,38 @@
+/var/log/syslog
+{
+ rotate 7
+ daily
+ missingok
+ notifempty
+ delaycompress
+ compress
+ postrotate
+ /etc/init.d/inetutils-syslogd reload &>/dev/null || true
+ endscript
+}
+
+/var/log/mail.info
+/var/log/mail.warn
+/var/log/mail.err
+/var/log/mail.log
+/var/log/daemon.log
+/var/log/kern.log
+/var/log/auth.log
+/var/log/user.log
+/var/log/lpr.log
+/var/log/cron.log
+/var/log/debug
+/var/log/messages
+{
+ rotate 4
+ weekly
+ missingok
+ notifempty
+ compress
+ delaycompress
+ sharedscripts
+ postrotate
+ /etc/init.d/inetutils-syslogd reload &>/dev/null || true
+ endscript
+}
+
diff --git a/testing/inetutils-syslogd/inetutils-syslogd.post-deinstall b/testing/inetutils-syslogd/inetutils-syslogd.post-deinstall
new file mode 100644
index 000000000..28f5dde8a
--- /dev/null
+++ b/testing/inetutils-syslogd/inetutils-syslogd.post-deinstall
@@ -0,0 +1,7 @@
+#!/bin/sh
+rc-update add syslog boot
+# show service status - cron will be stopped due to logger dependency
+echo "Cron:"; rc-service cron status
+echo "Syslog:"; rc-service syslog status
+
+
diff --git a/testing/inetutils-syslogd/inetutils-syslogd.post-install b/testing/inetutils-syslogd/inetutils-syslogd.post-install
new file mode 100644
index 000000000..5a327cb3b
--- /dev/null
+++ b/testing/inetutils-syslogd/inetutils-syslogd.post-install
@@ -0,0 +1,13 @@
+#!/bin/sh
+
+NORMAL="\033[1;0m"
+STRONG="\033[1;1m"
+GREEN="\033[1;32m"
+
+print_strong() {
+ local prompt="${STRONG}$1 ${GREEN}$2${NORMAL}"
+ printf "${prompt} %s\n"
+}
+
+print_strong "\nTo configure inetutils-syslogd / BusyBox Syslog Services & Runlevels execute:" "\n\n/sbin/setup-inetutils-syslogd\n"
+exit 0
diff --git a/testing/inetutils-syslogd/inetutils-syslogd.setup b/testing/inetutils-syslogd/inetutils-syslogd.setup
new file mode 100644
index 000000000..fd356dfa6
--- /dev/null
+++ b/testing/inetutils-syslogd/inetutils-syslogd.setup
@@ -0,0 +1,28 @@
+#!/bin/sh
+
+NORMAL="\033[1;0m"
+STRONG="\033[1;1m"
+RED="\033[1;31m"
+GREEN="\033[1;32m"
+
+print_stop() {
+ local prompt="${STRONG}$1 ${RED}$2${NORMAL}"
+ printf "${prompt} %s"
+}
+
+print_start() {
+ local prompt="${STRONG}$1 ${GREEN}$2${NORMAL}"
+ printf "${prompt} %s"
+}
+
+print_stop "\nWould you like to STOP BusyBox Syslog & remove it from the Boot Runlevel ?" "[ Enter or Y to remove ]:"; read ans
+if [ -z "$ans" ] || [ "$ans" = "y" ] || [ "$ans" = "Y" ]; then
+ echo; rc-update del syslog boot; rc-service syslog stop
+fi
+
+print_start "\nWould you like to START inetutils-syslogd & add it to the Boot Runlevel ?" "[ Enter or Y to add ]:"; read ans
+if [ -z "$ans" ] || [ "$ans" = "y" ] || [ "$ans" = "Y" ]; then
+ echo; rc-update add inetutils-syslogd boot; rc-service inetutils-syslogd start; rc-service cron restart; echo
+fi
+
+exit 0
diff --git a/testing/inetutils-syslogd/syslog.conf b/testing/inetutils-syslogd/syslog.conf
new file mode 100644
index 000000000..27141bf8e
--- /dev/null
+++ b/testing/inetutils-syslogd/syslog.conf
@@ -0,0 +1,38 @@
+#
+# First some standard log files. Log by facility.
+#
+auth,authpriv.* /var/log/auth.log
+*.*;auth,authpriv.none -/var/log/syslog
+cron.* /var/log/cron.log
+daemon.* -/var/log/daemon.log
+kern.* -/var/log/kern.log
+lpr.* -/var/log/lpr.log
+mail.* -/var/log/mail.log
+user.* -/var/log/user.log
+
+#
+# Logging for the mail system. Split it up so that
+# it is easy to write scripts to parse these files.
+#
+mail.info -/var/log/mail.info
+mail.warn -/var/log/mail.warn
+mail.err /var/log/mail.err
+
+#
+# Logging for INN news system.
+#
+news.crit /var/log/news/news.crit
+news.err /var/log/news/news.err
+news.notice -/var/log/news/news.notice
+
+#
+# Some "catch-all" log files.
+#
+*.=debug;\
+ auth,authpriv.none;\
+ news.none;mail.none -/var/log/debug
+*.=info;*.=notice;*.=warn;\
+ auth,authpriv.none;\
+ cron,daemon.none;\
+ mail,news.none -/var/log/messages
+