Summary: | app-backup/burp - /etc/init.d/burp improvements | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Marcin Mirosław <bug> |
Component: | Current packages | Assignee: | Amadeusz Żołnowski (RETIRED) <aidecoe> |
Status: | RESOLVED FIXED | ||
Severity: | normal | ||
Priority: | Normal | ||
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Bug Depends on: | |||
Bug Blocks: | 545808 | ||
Attachments: | improved init script |
Description
Marcin Mirosław
2014-12-20 23:25:18 UTC
Created attachment 392116 [details]
improved init script
Comment on attachment 392116 [details]
improved init script
--- files/burp.initd
+++ files/burp.initd
@@ -3,7 +3,16 @@
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/app-backup/burp/files/burp.initd,v 1.1 2014/12/01 16:28:47 aidecoe Exp $
-PIDFILE=/run/burp-server.pid
+command="/usr/sbin/burp"
+command_args="-c /etc/burp/burp-server.conf -F"
+command_background="yes"
+extra_started_commands="reload summary"
+pidfile=/run/burp-server.pid
+start_stop_daemon_arg="--make-pidfile --wait 500"
+
+description="Burp is a network backup and restore program"
+description_reload="Reloads burp configuration"
+description_summary="Displays burp status"
depend() {
need localmount
@@ -11,25 +20,21 @@
use net
}
-start() {
- ebegin "Starting burp server"
+start_pre() {
checkpath -o burp:burp -m 0775 -d /run/lock/burp
checkpath -o root:burp -m 0775 -d /etc/burp
checkpath -o root:burp -m 0775 -d /etc/burp/CA
checkpath -o root:burp -m 0750 -d /etc/burp/clientconfdir
checkpath -o root:burp -m 0640 -f /etc/burp/burp-server.conf
- start-stop-daemon --start \
- --pidfile "$PIDFILE" \
- --make-pidfile \
- --background \
- --wait 500 \
- --exec /usr/sbin/burp -- -c /etc/burp/burp-server.conf -F
- eend $? "Failed to start burp server"
}
-stop() {
- ebegin "Stopping burp server"
- start-stop-daemon --stop \
- --pidfile "$PIDFILE"
- eend $? "Failed to stop burp server"
+reload() {
+ ebegin "Reloading ${SVCNAME} configuration"
+ start-stop-daemon --exec ${command} --signal HUP
+ eend $?
+}
+
+summary() {
+ # it's a little tricky to use ${command_args} due to "-F"
+ "${command}" -a S ${command_args}
}
@jer: Why you've made the attachment obsolete? Thank you! + 09 Apr 2015; Amadeusz Żołnowski <aidecoe@gentoo.org> files/burp.initd: + Apply improvements to initd script by Marcin Mirosław. Fix bug #533150. + + Clean up script. Don't check /etc/burp/CA path because it's created correctly + by burp at startup. + |