aboutsummaryrefslogtreecommitdiffstats
path: root/testing/syslog-ng/syslog-ng.initd
diff options
context:
space:
mode:
authorJens Vehlhaber <jens@eisfair.org>2014-10-17 19:57:00 +0200
committerNatanael Copa <ncopa@alpinelinux.org>2014-10-20 12:34:39 +0000
commitd9504f0a8ea97d3c9594eb9af36cf79ac2164fb7 (patch)
treea83f3564b333c1c13ef2f18a488e054f81ae7725 /testing/syslog-ng/syslog-ng.initd
parent7944e5d3a403e68efffcef201d7e8abca5751fb5 (diff)
downloadaports-d9504f0a8ea97d3c9594eb9af36cf79ac2164fb7.tar.gz
aports-d9504f0a8ea97d3c9594eb9af36cf79ac2164fb7.tar.bz2
aports-d9504f0a8ea97d3c9594eb9af36cf79ac2164fb7.tar.xz
remove init.d handling with install scripts
Diffstat (limited to 'testing/syslog-ng/syslog-ng.initd')
-rw-r--r--testing/syslog-ng/syslog-ng.initd104
1 files changed, 52 insertions, 52 deletions
diff --git a/testing/syslog-ng/syslog-ng.initd b/testing/syslog-ng/syslog-ng.initd
index b657b81c1e..647c1058c2 100644
--- a/testing/syslog-ng/syslog-ng.initd
+++ b/testing/syslog-ng/syslog-ng.initd
@@ -6,71 +6,71 @@ extra_commands="update"
extra_started_commands="reload"
depend() {
- need hostname localmount
- before net
- provide logger
+ need hostname localmount
+ before net
+ provide logger
}
start() {
- [ ! -f /etc/syslog-ng/syslog.conf ] && update
- ebegin "Starting syslog-ng"
- start-stop-daemon --start --quiet --exec /usr/sbin/syslog-ng --pidfile /var/run/syslog-ng.pid
- eend $?
+ [ ! -f /etc/syslog-ng/syslog.conf ] && update
+ ebegin "Starting syslog-ng"
+ start-stop-daemon --start --quiet --exec /usr/sbin/syslog-ng --pidfile /run/syslog-ng.pid
+ eend $?
}
stop() {
- ebegin "Stopping syslog-ng"
- start-stop-daemon --stop --quiet --pidfile /var/run/syslog-ng.pid --exec /usr/sbin/syslog-ng
- eend $?
+ ebegin "Stopping syslog-ng"
+ start-stop-daemon --stop --quiet --pidfile /run/syslog-ng.pid --exec /usr/sbin/syslog-ng
+ eend $?
}
reload() {
- if [ ! -f /var/run/syslog-ng.pid ]
- then
- eerror "syslog-ng not running!"
- return 1
- fi
- ebegin "Reloading syslog-ng"
- start-stop-daemon --signal HUP --pidfile /var/run/syslog-ng.pid --exec /usr/sbin/syslog-ng
- eend $?
+ 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
+ eend $?
}
grep_syslog_conf_entries() {
- local section="$1" FN filelist
- grep -v '^#' /etc/syslog-ng/syslog-ng-${section}.std
- filelist=$(find /etc/syslog-ng/ -maxdepth 1 -type f -name "syslog-ng-${section}.*" | grep -Ev ".backup|.std|~")
- if [ $? -eq 0 ]
- then
- for FN in ${filelist}
- do
- grep -v '^#' $FN
- done
- fi
+ local section="$1" FN filelist
+ grep -v '^#' /etc/syslog-ng/syslog-ng-${section}.std
+ filelist=$(find /etc/syslog-ng/ -maxdepth 1 -type f -name "syslog-ng-${section}.*" | grep -Ev ".backup|.std|~")
+ if [ $? -eq 0 ]
+ then
+ for FN in ${filelist}
+ do
+ grep -v '^#' $FN
+ done
+ fi
}
update() {
- local fname='/etc/syslog-ng/syslog-ng.conf'
- local f_tmp="/etc/syslog-ng/syslog-ng.conf.$$"
- for ng_std in options source destination filter log
- do
- [ -f /etc/syslog-ng/syslog-ng-${ng_std}.std ] || exit 1
- done
- {
- # create options entries
- echo "options {"
- grep_syslog_conf_entries options
- echo "};"
- # create source entries
- echo "source s_all {"
- grep_syslog_conf_entries source
- echo "};"
- # create destination entries
- grep_syslog_conf_entries destination
- # create filter entries
- grep_syslog_conf_entries filter
- # create log entries
- grep_syslog_conf_entries log
- } > $f_tmp
- cp -p $f_tmp $fname
- rm -f $f_tmp
+ local fname='/etc/syslog-ng/syslog-ng.conf'
+ local f_tmp="/etc/syslog-ng/syslog-ng.conf.$$"
+ for ng_std in options source destination filter log
+ do
+ [ -f /etc/syslog-ng/syslog-ng-${ng_std}.std ] || exit 1
+ done
+ {
+ # create options entries
+ echo "options {"
+ grep_syslog_conf_entries options
+ echo "};"
+ # create source entries
+ echo "source s_all {"
+ grep_syslog_conf_entries source
+ echo "};"
+ # create destination entries
+ grep_syslog_conf_entries destination
+ # create filter entries
+ grep_syslog_conf_entries filter
+ # create log entries
+ grep_syslog_conf_entries log
+ } > $f_tmp
+ cp -p $f_tmp $fname
+ rm -f $f_tmp
}