summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2005-02-12 00:59:21 +0000
committerMike Frysinger <vapier@gentoo.org>2005-02-12 00:59:21 +0000
commit2ba855e13700fd48e35f4eb3efa2ad524c7f970c (patch)
tree65d5fb8e0cdc850e37f6751f563e79db75d7d52c /app-admin/sysklogd
parentFix digest. (diff)
downloadgentoo-2-2ba855e13700fd48e35f4eb3efa2ad524c7f970c.tar.gz
gentoo-2-2ba855e13700fd48e35f4eb3efa2ad524c7f970c.tar.bz2
gentoo-2-2ba855e13700fd48e35f4eb3efa2ad524c7f970c.zip
Add custom reload() func by Cory Visi to init.d script #52044.
(Portage version: 2.0.51-r15)
Diffstat (limited to 'app-admin/sysklogd')
-rw-r--r--app-admin/sysklogd/ChangeLog5
-rw-r--r--app-admin/sysklogd/files/sysklogd.rc637
2 files changed, 25 insertions, 17 deletions
diff --git a/app-admin/sysklogd/ChangeLog b/app-admin/sysklogd/ChangeLog
index 297d77d7dc6b..1c005a03dc3c 100644
--- a/app-admin/sysklogd/ChangeLog
+++ b/app-admin/sysklogd/ChangeLog
@@ -1,6 +1,9 @@
# ChangeLog for app-admin/sysklogd
# Copyright 2002-2005 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/app-admin/sysklogd/ChangeLog,v 1.36 2005/01/01 11:29:42 eradicator Exp $
+# $Header: /var/cvsroot/gentoo-x86/app-admin/sysklogd/ChangeLog,v 1.37 2005/02/12 00:59:21 vapier Exp $
+
+ 11 Feb 2005; Mike Frysinger <vapier@gentoo.org> files/sysklogd.rc6:
+ Add custom reload() func by Cory Visi to init.d script #52044.
28 Dec 2004; Ciaran McCreesh <ciaranm@gentoo.org> :
Change encoding to UTF-8 for GLEP 31 compliance
diff --git a/app-admin/sysklogd/files/sysklogd.rc6 b/app-admin/sysklogd/files/sysklogd.rc6
index 7d6a547e54e3..5ae5a62ad9ee 100644
--- a/app-admin/sysklogd/files/sysklogd.rc6
+++ b/app-admin/sysklogd/files/sysklogd.rc6
@@ -1,10 +1,9 @@
#!/sbin/runscript
-# Copyright 1999-2004 Gentoo Foundation
+# Copyright 1999-2005 Gentoo Foundation
# Distributed under the terms of the GNU General Public License, v2 or later
-# $Header: /var/cvsroot/gentoo-x86/app-admin/sysklogd/files/sysklogd.rc6,v 1.9 2004/07/24 21:38:37 azarah Exp $
-
-# NB: Config is in /etc/conf.d/sysklogd
+# $Header: /var/cvsroot/gentoo-x86/app-admin/sysklogd/files/sysklogd.rc6,v 1.10 2005/02/12 00:59:21 vapier Exp $
+opts="reload"
depend() {
need clock hostname
@@ -13,12 +12,11 @@ depend() {
start_daemon() {
local retval=0
- local daemon="$1"
- local options="$2"
-
- [ -z "${daemon}" ] && return 1
+ local daemon=$1
+ local options=$2
- [ -n "${options}" ] && options="-- ${options}"
+ [[ -z ${daemon} ]] && return 1
+ [[ -n ${options} ]] && options="-- ${options}"
ebegin "sysklogd -> start: ${daemon}"
start-stop-daemon --start --quiet --background \
@@ -31,9 +29,9 @@ start_daemon() {
stop_daemon() {
local retval=0
- local daemon="$1"
+ local daemon=$1
- [ -z "${daemon}" ] && return 1
+ [[ -z ${daemon} ]] && return 1
ebegin "sysklogd -> stop: ${daemon}"
# syslogd can be stubborn some times (--retry 15)...
@@ -47,12 +45,12 @@ stop_daemon() {
start() {
start_daemon "syslogd" "${SYSLOGD}" || return 1
-
+
# klogd do not always start proper if started too early
sleep 1
-
+
start_daemon "klogd" "${KLOGD}" || {
- if [ -n "`pidof syslogd`" ]; then
+ if [[ -n $(pidof syslogd) ]] ; then
stop_daemon "syslogd"
fi
return 1
@@ -66,9 +64,9 @@ stop() {
# Give klogd time to stop
sleep 1
-
+
stop_daemon "syslogd" || {
- if [ -n "`pidof syslogd`" ]; then
+ if [[ -n $(pidof syslogd) ]] ; then
# Not sure if we should really try to start
# klogd again ...
start_daemon "klogd" "${KLOGD}"
@@ -79,3 +77,10 @@ stop() {
return 0
}
+reload() {
+ local ret=0
+ ebegin "Reloading configuration"
+ killall -HUP syslogd &> /dev/null ; ret=$((ret+$?))
+ killall -USR2 klogd &> /dev/null ; ret=$((ret+$?))
+ eend ${ret}
+}