You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gentoo-overlay/app-admin/logsurfer+/files/logsurfer-1.8.initd

51 lines
1.0 KiB

#!/sbin/openrc-run
# Copyright 1999-2016 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
pidfile="/var/run/logsurfer.pid"
command="/usr/bin/logsurfer"
command_args="-D -p ${pidfile} ${LOGSURFER_OPTS}"
extra_started_commands="reload dump"
conffile="/etc/logsurfer.conf"
depend() {
use logger
}
checkconfig() {
if [ ! -f /etc/logsurfer.conf ] ; then
eerror "Please create /etc/logsurfer.conf"
return 1
fi
return 0
}
start_pre() {
checkconfig || return $?
checkpath --file --owner logsurfer --mode 0644 "${pidfile}"
}
start() {
ebegin "Starting ${SVCNAME}"
start-stop-daemon \
--start \
--user logsurfer \
--exec ${command} \
-- ${command_args}
eend $? "Failed to start ${SVCNAME}"
}
reload() {
ebegin "Reloading ${SVCNAME}"
start-stop-daemon --signal HUP --pidfile "${pidfile}"
eend $? "Failed to reload ${SVCNAME}"
}
dump() {
ebegin "Dumping ${SVCNAME} internal state"
start-stop-daemon --signal USR1 --pidfile "${pidfile}"
eend $? "Failed to dump ${SVCNAME} internal state"
}