aboutsummaryrefslogtreecommitdiffstats
path: root/main/syslog-ng
diff options
context:
space:
mode:
Diffstat (limited to 'main/syslog-ng')
-rw-r--r--main/syslog-ng/APKBUILD3
-rw-r--r--[-rwxr-xr-x]main/syslog-ng/syslog-ng.initd51
2 files changed, 33 insertions, 21 deletions
diff --git a/main/syslog-ng/APKBUILD b/main/syslog-ng/APKBUILD
index 7ef7c441ba..ead22161e3 100644
--- a/main/syslog-ng/APKBUILD
+++ b/main/syslog-ng/APKBUILD
@@ -123,6 +123,7 @@ package() {
install -D -m 644 "$srcdir"/$pkgname.logrotate etc/logrotate.d/$pkgname
install -d -m 755 etc/$pkgname/conf.d
+ install -d -m 700 "$pkgdir"/var/lib/syslog-ng
}
scl() {
@@ -166,4 +167,4 @@ _submv() {
sha512sums="2e6ea690f8762f3f37885118f023048c4cba59f58002c87fa1c469cb991b2ba707015b3e54c50f17c3d6e6251d798557406925a9159f4fa914331f281dc39e48 syslog-ng-3.18.1.tar.gz
556726815bd032a44623b809e3b9b92920eb115ae1626cdd0b1d7c6772c1464f2364bbe5a39b5d1ceebdca63b270aa10b402f615f820a44f85a7a2bbd5631448 syslog-ng.conf
1825b85fb584c5cecf0ad370e81a7473b5c973ce10adce386d1ba5f68432abe4e2f54c937d7d94edb22dbd9031eff483bd113bc3244ce0d0072cf4bf4ab5c2cc syslog-ng.logrotate
-9caac269ed561cfe5b3a0b4e443037e7c9105bf22b2e7830916d1a8baf62682566ee1f8ed96fe62f1755903fb7b8caf406aaa151d49213a7eff62d6d3ce0c87c syslog-ng.initd"
+873fef8815131f0acc618fa4911cd1eda59e260adc1eaae6eb91034900ce789f05ee48fa8afa4a87763026c18c87aef351e7ea76e0cbb46bcd5297f9ca14d527 syslog-ng.initd"
diff --git a/main/syslog-ng/syslog-ng.initd b/main/syslog-ng/syslog-ng.initd
index 38144142f8..9a3dc47a58 100755..100644
--- a/main/syslog-ng/syslog-ng.initd
+++ b/main/syslog-ng/syslog-ng.initd
@@ -1,35 +1,46 @@
#!/sbin/openrc-run
-# Copyright 1999-2007 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-extra_commands="update"
+extra_commands="checkconfig"
extra_started_commands="reload"
+description_checkconfig="Check the configuration file"
+description_reload="Reload the configuration without exiting"
+
+: ${cfgfile:="/etc/syslog-ng/$RC_SVCNAME.conf"}
+: ${statedir:="/var/lib/syslog-ng"}
+: ${control_file:="$statedir/$RC_SVCNAME.ctl"}
+: ${persist_file:="$statedir/$RC_SVCNAME.persist"}
+
+pidfile="/run/$RC_SVCNAME.pid"
+command="/usr/sbin/syslog-ng"
+command_args="
+ --cfgfile $cfgfile
+ --control $control_file
+ --persist-file $persist_file
+ --pidfile $pidfile
+ $command_args"
+
+required_files="$cfgfile"
+required_dirs="$statedir"
+
depend() {
+ use clock
need hostname localmount
before net
+ after bootmisc
provide logger
}
-start() {
- ebegin "Starting syslog-ng"
- start-stop-daemon --start --quiet --pidfile /run/syslog-ng.pid --exec /usr/sbin/syslog-ng -- --process-mode background
- eend $?
-}
-
-stop() {
- ebegin "Stopping syslog-ng"
- start-stop-daemon --stop --quiet --pidfile /run/syslog-ng.pid
- eend $?
+checkconfig() {
+ ebegin "Checking $RC_SVCNAME configuration"
+ syslog-ng -s -f "$cfgfile"
+ eend $? "Configuration error. Please fix your configfile ($cfgfile)"
}
reload() {
- if [ ! -f /run/syslog-ng.pid ]
- then
- eerror "syslog-ng not running!"
- return 1
- fi
- ebegin "Reloading syslog-ng"
- start-stop-daemon --signal HUP --pidfile /run/syslog-ng.pid --exec /usr/sbin/syslog-ng
+ checkconfig || return 1
+
+ ebegin "Reloading configuration and re-opening log files"
+ start-stop-daemon --signal HUP --pidfile "$pidfile"
eend $?
}