Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 533150

Summary: app-backup/burp - /etc/init.d/burp improvements
Product: Gentoo Linux Reporter: Marcin Mirosław <bug>
Component: Current packagesAssignee: 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
Hi, I'm attaching improved version of init script for burp daemon. It's completly rewritten so there is no point to paste diff.
I've added extra_started_commands "reload" and "summary" and description for them. Removed start() and stop() functions.
Comment 1 Marcin Mirosław 2014-12-20 23:27:09 UTC
Created attachment 392116 [details]
improved init script
Comment 2 Jeroen Roovers (RETIRED) gentoo-dev 2014-12-21 11:20:10 UTC
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}
 }
Comment 3 Amadeusz Żołnowski (RETIRED) gentoo-dev 2014-12-21 11:32:07 UTC
@jer: Why you've made the attachment obsolete?
Comment 4 Amadeusz Żołnowski (RETIRED) gentoo-dev 2015-04-09 15:19:53 UTC
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.
+