aboutsummaryrefslogtreecommitdiffstats
path: root/main
diff options
context:
space:
mode:
authorJakub Jirutka <jakub@jirutka.cz>2019-01-27 00:41:20 +0100
committerJakub Jirutka <jakub@jirutka.cz>2019-01-28 01:51:37 +0100
commitc24314f73b7bb44a6d16b359ecb62050703c917d (patch)
tree5a1dcd53ab556dbcfc566570d5eb01ba0d2d2d4b /main
parente5d012de60e3e83dd28cd5e592ad3282a55031fe (diff)
downloadaports-c24314f73b7bb44a6d16b359ecb62050703c917d.tar.bz2
aports-c24314f73b7bb44a6d16b359ecb62050703c917d.tar.xz
main/rsyslog: modernize init script
Diffstat (limited to 'main')
-rw-r--r--main/rsyslog/APKBUILD5
-rw-r--r--main/rsyslog/rsyslog.confd17
-rw-r--r--main/rsyslog/rsyslog.initd43
3 files changed, 16 insertions, 49 deletions
diff --git a/main/rsyslog/APKBUILD b/main/rsyslog/APKBUILD
index 636ed0b118..01b9dab09c 100644
--- a/main/rsyslog/APKBUILD
+++ b/main/rsyslog/APKBUILD
@@ -32,7 +32,6 @@ install="$pkgname.post-upgrade"
subpackages="$pkgname-doc $pkgname-dbg"
source="https://www.rsyslog.com/files/download/$pkgname/$pkgname-$pkgver.tar.gz
$pkgname.initd
- $pkgname.confd
$pkgname.logrotate
$pkgname.conf
musl-fix.patch
@@ -94,7 +93,6 @@ package() {
rm -f "$pkgdir"/usr/lib/rsyslog/imdiag.so
install -m755 -D "$srcdir"/$pkgname.initd "$pkgdir"/etc/init.d/$pkgname
- install -m644 -D "$srcdir"/$pkgname.confd "$pkgdir"/etc/conf.d/$pkgname
install -m644 -D "$srcdir"/$pkgname.logrotate "$pkgdir"/etc/logrotate.d/$pkgname
install -m644 -D "$srcdir"/$pkgname.conf "$pkgdir"/etc/$pkgname.conf
}
@@ -120,8 +118,7 @@ _plugin() {
}
sha512sums="3d5d4f92e37ad9bf3767d5d7fc87fcb7956656f676a9495c78abd12fe9072ec8763b50543b198308a71d5d919721fb9b84b6725dd83a9d9b8a1639d81382c0dd rsyslog-8.40.0.tar.gz
-9a4b184076a82e0899da79ab3749e1c67eac03f36c4460d34ed0385f4a3ffad53681a1cc25dd514e835c9399a9abd01c235743535ad549d5be7f66d9e127b9dc rsyslog.initd
-a4d969671800227129be870b0318961b79d16365663754111a136734bbf7005abd4da24853dfdc07b3b6691ab5a7b215f0ac6c19022b4c5c8dab06165a42431b rsyslog.confd
+bcd63c8df2ac63b80f3cb51ba7f544988df6cd875f4e81020e762dff30d7537f21b72c95a4b1c08baf15f4ed5f03defbf3f061673aabada5841f45ab9f579374 rsyslog.initd
d54377ddf39197656811a84272568ea761f984e19dd04fc54f372dd04a9244e66d02b26ab33073d0344d054f031660ec611f3c7a18c266e7b68cef5e2c47f06f rsyslog.logrotate
3bcd58b222eb7f4d8a42a0643cacb6ab44790f90c9bd550678e002bc19863d5d6a7341e5e5ba0b9292f85c6c04cd5cc42d174acdc63e8ba22022620db10f2b9b rsyslog.conf
04f1c8060b9439fe25f9a4291697c577fb3d540aefcd67ed6d63d416c1dd0306fa68ae89745af2b4dc2e288d46aadd9c7a96ccfaaf3a146d9d76bd3433e3c1a5 musl-fix.patch
diff --git a/main/rsyslog/rsyslog.confd b/main/rsyslog/rsyslog.confd
deleted file mode 100644
index c3ad774742..0000000000
--- a/main/rsyslog/rsyslog.confd
+++ /dev/null
@@ -1,17 +0,0 @@
-# Copyright 1999-2010 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/app-admin/rsyslog/files/5-stable/rsyslog.confd,v 1.1 2010/10/21 07:38:29 dev-zero Exp $
-
-# Configuration file
-CONFIGFILE="/etc/rsyslog.conf"
-
-# PID file
-PIDFILE="/var/run/rsyslogd.pid"
-
-# Options to rsyslogd
-# See rsyslogd(8) for more details
-# Notes:
-# * Do not specify another PIDFILE but use the variable above to change the location
-# * Do not specify another CONFIGFILE but use the variable above to change the location
-# * "-c5" tells rsyslog to _not_ run in sysklogd compatibility mode
-RSYSLOG_OPTS=""
diff --git a/main/rsyslog/rsyslog.initd b/main/rsyslog/rsyslog.initd
index 682f1e2652..f870ba3b2b 100644
--- a/main/rsyslog/rsyslog.initd
+++ b/main/rsyslog/rsyslog.initd
@@ -1,39 +1,26 @@
#!/sbin/openrc-run
-# Copyright 1999-2010 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/app-admin/rsyslog/files/5-stable/rsyslog.initd,v 1.1 2010/10/21 07:38:29 dev-zero Exp $
extra_started_commands="reload"
-depend() {
- need clock hostname localmount
- provide logger
-}
+description_reload="Reload the configuration and re-open log files"
-start() {
- ebegin "Starting rsyslogd"
- start-stop-daemon \
- --start --quiet --exec /usr/sbin/rsyslogd \
- -- ${RSYSLOG_OPTS} -i "${PIDFILE}" -f "${CONFIGFILE}"
- eend $?
-}
+: ${cfgfile:=${CONFIGFILE:="/etc/rsyslog.conf"}}
-stop() {
- ebegin "Stopping rsyslogd"
- start-stop-daemon \
- --stop --quiet \
- --pidfile "${PIDFILE}"
- eend $?
+pidfile="/run/$RC_SVCNAME.pid"
+command="/usr/sbin/rsyslogd"
+command_args="-i $pidfile -f $cfgfile ${command_args:-$RSYSLOG_OPTS}"
+
+required_files="$cfgfile"
+
+depend() {
+ need hostname localmount
+ use clock
+ before net
+ provide logger
}
reload() {
- if [ ! -f "${PIDFILE}" ]; then
- eerror "rsyslogd not running"
- return 1
- fi
-
- ebegin "Re-opening rsyslogd log files"
- start-stop-daemon --stop --signal HUP \
- --pidfile "${PIDFILE}"
+ ebegin "Reloading configuration and re-opening log files"
+ start-stop-daemon --signal HUP --pidfile "$pidfile"
eend $?
}