diff options
author | Reinhard Tartler <siretart@tauware.de> | 2009-03-31 15:58:19 +0200 |
---|---|---|
committer | Reinhard Tartler <siretart@tauware.de> | 2009-03-31 15:58:19 +0200 |
commit | 25db897553a0db0f912602b375029e724f51556e (patch) | |
tree | 613c8c23e22481e31a4d2f474e022ad87728da24 /contrib | |
parent | 2787035d98661881477d696403ca2a78b49322d5 (diff) |
Import upstream version 0.11~rc2+r2072
Diffstat (limited to 'contrib')
-rw-r--r-- | contrib/cygwin/README.txt | 30 | ||||
-rwxr-xr-x | contrib/cygwin/install-cygwin-service.pl.in | 112 | ||||
-rwxr-xr-x | contrib/cygwin/remove-cygwin-service.sh | 14 | ||||
-rwxr-xr-x | contrib/debian/bbackupd | 46 | ||||
-rwxr-xr-x | contrib/debian/bbstored | 46 | ||||
-rwxr-xr-x | contrib/redhat/bbackupd | 83 | ||||
-rwxr-xr-x | contrib/redhat/bbstored | 83 | ||||
-rw-r--r-- | contrib/rpm/boxbackup.spec | 9 | ||||
-rwxr-xr-x | contrib/suse/bbackupd | 103 | ||||
-rwxr-xr-x | contrib/suse/bbstored | 104 |
10 files changed, 164 insertions, 466 deletions
diff --git a/contrib/cygwin/README.txt b/contrib/cygwin/README.txt new file mode 100644 index 00000000..83f32fd9 --- /dev/null +++ b/contrib/cygwin/README.txt @@ -0,0 +1,30 @@ + Making boxbackup run as a Windows Service + +For most installations (with the default locations for config files, +etc.) running the install-cygwin-service.pl script will complete the +installation painlessly, and you will have a running bbackupd after +completing the installation, and whenever you reboot. + +Simply run the script: + +perl install-cygwin-service.pl + +The service can be monitored in the Windows Service Manager. It is named +boxbackup. + +For non-standard configurations, there are command-line options to point +the script to the bbackupd.conf config file, and the bbackupd.exe +executable: + +perl install-cygwin-service.pl [-c <path-to-bbackupd-config-file>] [-e +<path-to-bbackupd-executable-file>] + + + Removing the Service + +If you decide not to run backups on a machine anymore, simply remove the +service by running: + +sh remove-cygwin-service.sh + + diff --git a/contrib/cygwin/install-cygwin-service.pl.in b/contrib/cygwin/install-cygwin-service.pl.in new file mode 100755 index 00000000..a580e99c --- /dev/null +++ b/contrib/cygwin/install-cygwin-service.pl.in @@ -0,0 +1,112 @@ +#!@PERL@ -w + + +# Contributed to the boxbackup project by Per Reedtz Thomsen. pthomsen@reedtz.com + +# This script reads the config file for boxbackup, and changes the mode +# of the directory named by 'DataDirectory' and any files there. Also, +# the files pointed to by the 'CommandSocket' and 'PidFile' configuration +# parameters will be chmod'ed to be read-write by all. +# The Windows services are created and started using the 'cygrunsrv' utility. + +# Date Who Comments +# 20041005 pthomsen@reedtz.com Created +# 20041020 pthomsen@reedtz.com Switched to using Getopt::Std for cmd-line things. + +use strict; + +use Getopt::Std; +getopt('ce'); +our ($opt_c, $opt_e); +# Figure out the config file to use. Default is /etc/box/bbackupd.conf +my $confFile = (defined($opt_c) ? $opt_c : "/etc/box/bbackupd.conf"); +# Figure out the bbaackupd executable to use. Default is /usr/local/bin/bbackupd.exe +my $exeFile = (defined($opt_e) ? $opt_e : "/usr/local/bin/bbackupd.exe"); + +die "File $confFile does not exist. Please provide the full path to the bbackupd configuration file.\n" if !(-f $confFile); +die "Can't read $confFile. Permission denied. Please chmod the file so I can read it.\n" if !(-r $confFile); +die "File $exeFile does not exist. Please provide the full path to the bbackupd.exe file.\n" if !(-f $exeFile); +die "File $exeFile is not executable. Please provide the full path to the correct bbackupd.exe file.\n" if !(-x $exeFile); + +# print "Config: $confFile\n"; + +my $dataDir; +my $cmdSocket; +my $pidFile; + +open (CONFIG, "<$confFile") or die "Can't open $confFile: $!\n"; + +# Read the confgiguration file, and pull the DataDirectory, CommandSocket, and PidFile parameters. +while (<CONFIG>) +{ + + if (/^\s*DataDirectory\s*=\s*([^\n\s]+)\s*\n/) + { + $dataDir = $1; + next; + } + + if (/^\s*CommandSocket\s*=\s*([^\n\s]+)\s*\n/) + { + $cmdSocket = $1; + next; + } + if (/^\s*PidFile\s*=\s*([^\n\s]+)\s*\n/) + { + $pidFile = $1; + next; + } +} + +# check that we got all the parameters from the file. If not, die. +if ((!defined($dataDir)) || (!defined($cmdSocket)) || (!defined($pidFile))) +{ + die "Could not read config parameters from $confFile. Values retrieved:\n\tDataDirectory = $dataDir\n\tCommandSocket = $cmdSocket\n\tPidFile = $pidFile\n"; +} + + +print "Parameters retrieved from $confFile. Values:\n\tDataDirectory = $dataDir\n\tCommandSocket = $cmdSocket\n\tPidFile = $pidFile\n"; +print "chmod..."; +# change the mode of the files/dirs retrieved. +chmod(0777, $dataDir) or die "Can't chmod $dataDir: $!\n"; +chmod(0666, "$dataDir/*") or die "Can't chmod $dataDir/*: $!\n"; +chmod(0666, $pidFile) or die "Can't chmod $pidFile: $!\n"; +chmod(0755, $cmdSocket) or die "Can't chmod $cmdSocket: $!\n"; +print " Done.\n"; + +# Now install the service using cygrunsrv. +# Details: +# -I <svc_name> Install a service. svc_name is the name under which the +# service will appear in the Windows Service Manager +# -p <path_to_exe> Path to the executable. +# -a <options> Command line options to the executable. +# -f <description> Description of the service. +# -o Attempt clean exit of service during system shutdown + +print "Installing boxbackup service..."; +my $sysCmd = "cygrunsrv.exe -I boxbackup -p " . $exeFile; +$sysCmd .= " -a \"" . $confFile . " SINGLEPROCESS\""; +$sysCmd .= " -o -f \"Online Backup System by Ben Summers\""; +print "$sysCmd\n"; +my $output = qx($sysCmd); +die "cygrunsrv failed to install service. Error Message: $output\n" if($output ne ""); +print " Done.\n"; + + +# Start the service +# Details: +# -S <svc_name> Start a service. svc_name is the name of the (installed) +# service to start. + +print "Starting boxbackup service..."; +$sysCmd = "cygrunsrv.exe -S boxbackup"; +print "$sysCmd\n"; +$output = qx($sysCmd); +die "cygrunsrv failed to start service. Error Message: $output\n" if($output ne ""); +print " Done.\n"; + +print "\n\nService Installation complete. To test, reboot your machine, and make sure that\n"; +print "the boxbackup service is running. A good way to make sure, is to check that the account number\n"; +print "from this machine is connecting to the bbstored server. Check the bbstored logs for more info.\n\n"; + + diff --git a/contrib/cygwin/remove-cygwin-service.sh b/contrib/cygwin/remove-cygwin-service.sh new file mode 100755 index 00000000..e766333d --- /dev/null +++ b/contrib/cygwin/remove-cygwin-service.sh @@ -0,0 +1,14 @@ +#!/bin/bash + +# Contributed to the boxbackup project by Per Reedtz Thomsen. pthomsen@reedtz.com + +# This script removes the 'boxbackup' service from the Windows service manager +# using the cygrunsrv utility. + +# Date Who Comments +# 20041005 pthomsen@reedtz.com Created + +cygrunsrv -R boxbackup + +echo "Service \"boxbackup\" removed." + diff --git a/contrib/debian/bbackupd b/contrib/debian/bbackupd deleted file mode 100755 index f114c5d2..00000000 --- a/contrib/debian/bbackupd +++ /dev/null @@ -1,46 +0,0 @@ -#! /bin/sh - -# Start and stop the Box Backup client daemon. - -BBACKUPD=/usr/local/bin/bbackupd -CONFIG=/etc/box/bbackupd.conf -PIDFILE=/var/run/bbackupd.pid - -test -x $BBACKUPD || exit 0 -test -f $CONFIG || exit 0 - -case $1 in - start) - echo -n "Starting Box Backup Client daemon: bbackupd" - start-stop-daemon --start --quiet --exec $BBACKUPD > /dev/null - echo "." - ;; - - stop) - echo -n "Stopping Box Backup Client daemon: bbackupd" - start-stop-daemon --stop --quiet \ - --pidfile $PIDFILE --exec $BBACKUPD - echo "." - ;; - - reload|force-reload) - echo -n "Reloading Box Backup Client configuration" - start-stop-daemon --stop --signal 1 --quiet --oknodo \ - --pidfile $PIDFILE --exec $BBACKUPD - echo "." - ;; - - restart) - echo -n "Restarting Box Backup Client daemon: bbackupd" - start-stop-daemon --stop --quiet --pidfile $PIDFILE \ - --exec $BBACKUPD - start-stop-daemon --start --quiet \ - --exec $BBACKUPD > /dev/null - echo "." - ;; - *) - echo "Usage: /etc/init.d/bbackupd {start|stop|reload|force-reload|restart}" - exit 1 -esac - -exit 0 diff --git a/contrib/debian/bbstored b/contrib/debian/bbstored deleted file mode 100755 index d5ba2ac5..00000000 --- a/contrib/debian/bbstored +++ /dev/null @@ -1,46 +0,0 @@ -#! /bin/sh - -# Start and stop the Box Backup server daemon. - -BBSTORED=/usr/local/bin/bbstored -CONFIG=/etc/box/bbstored.conf -PIDFILE=/var/run/bbstored.pid - -test -x $BBACKUPD || exit 0 -test -f $CONFIG || exit 0 - -case $1 in - start) - echo -n "Starting Box Backup Server daemon: bbstored" - start-stop-daemon --start --quiet --exec $BBSTORED > /dev/null - echo "." - ;; - - stop) - echo -n "Stopping Box Backup Server daemon: bbstored" - start-stop-daemon --stop --quiet \ - --pidfile $PIDFILE --exec $BBSTORED - echo "." - ;; - - reload|force-reload) - echo -n "Reloading Box Backup Server configuration" - start-stop-daemon --stop --signal 1 --quiet --oknodo \ - --pidfile $PIDFILE --exec $BBSTORED - echo "." - ;; - - restart) - echo -n "Restarting Box Backup Server daemon: bbstored" - start-stop-daemon --stop --quiet --pidfile $PIDFILE \ - --exec $BBSTORED - start-stop-daemon --start --quiet \ - --exec $BBSTORED > /dev/null - echo "." - ;; - - *) - echo "Usage: /etc/init.d/bbstored {start|stop|reload|force-reload|restart}" -esac - -exit 0 diff --git a/contrib/redhat/bbackupd b/contrib/redhat/bbackupd deleted file mode 100755 index 71deab1b..00000000 --- a/contrib/redhat/bbackupd +++ /dev/null @@ -1,83 +0,0 @@ -#! /bin/bash -# -# bbackupd Start/Stop the box backup client daemon. -# -# chkconfig: 345 93 07 -# description: bbackupd is the client side deamon for Box Backup, \ -# a completely automatic on-line backup system. -# processname: bbackupd -# config: /etc/box -# pidfile: /var/run/bbackupd.pid - -# Source function library. -. /etc/init.d/functions - -RETVAL=0 - -# See how we were called. - -prog="bbackupd" - -# Check that configuration exists. -[ -f /etc/box/$prog.conf ] || exit 0 - -start() { - echo -n $"Starting $prog: " - daemon $prog - RETVAL=$? - echo - [ $RETVAL -eq 0 ] && touch /var/lock/subsys/$prog - return $RETVAL -} - -stop() { - echo -n $"Stopping $prog: " - killproc $prog - RETVAL=$? - echo - [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/$prog - return $RETVAL -} - -rhstatus() { - status $prog -} - -restart() { - stop - start -} - -reload() { - echo -n $"Reloading $prog configuration: " - killproc $prog -HUP - retval=$? - echo - return $RETVAL -} - -case "$1" in - start) - start - ;; - stop) - stop - ;; - restart) - restart - ;; - reload) - reload - ;; - status) - rhstatus - ;; - condrestart) - [ -f /var/lock/subsys/$prog ] && restart || : - ;; - *) - echo $"Usage: $0 {start|stop|status|reload|restart|condrestart}" - exit 1 -esac - -exit $? diff --git a/contrib/redhat/bbstored b/contrib/redhat/bbstored deleted file mode 100755 index 09e2b490..00000000 --- a/contrib/redhat/bbstored +++ /dev/null @@ -1,83 +0,0 @@ -#! /bin/bash -# -# bbstored Start/Stop the box backup server daemon. -# -# chkconfig: 345 93 07 -# description: bbstored is the server side daemon for Box Backup, \ -# a completely automatic on-line backup system. -# processname: bbstored -# config: /etc/box -# pidfile: /var/run/bbstored.pid - -# Source function library. -. /etc/init.d/functions - -RETVAL=0 - -# See how we were called. - -prog="bbstored" - -# Check that configuration exists. -[ -f /etc/box/$prog.conf ] || exit 0 - -start() { - echo -n $"Starting $prog: " - daemon $prog - RETVAL=$? - echo - [ $RETVAL -eq 0 ] && touch /var/lock/subsys/$prog - return $RETVAL -} - -stop() { - echo -n $"Stopping $prog: " - killproc $prog - RETVAL=$? - echo - [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/$prog - return $RETVAL -} - -rhstatus() { - status $prog -} - -restart() { - stop - start -} - -reload() { - echo -n $"Reloading $prog configuration: " - killproc $prog -HUP - retval=$? - echo - return $RETVAL -} - -case "$1" in - start) - start - ;; - stop) - stop - ;; - restart) - restart - ;; - reload) - reload - ;; - status) - rhstatus - ;; - condrestart) - [ -f /var/lock/subsys/$prog ] && restart || : - ;; - *) - echo $"Usage: $0 {start|stop|status|reload|restart|condrestart}" - exit 1 -esac - -exit $? diff --git a/contrib/rpm/boxbackup.spec b/contrib/rpm/boxbackup.spec index c3cdbe39..a5b287ff 100644 --- a/contrib/rpm/boxbackup.spec +++ b/contrib/rpm/boxbackup.spec @@ -7,6 +7,13 @@ # builds. %define distribution_dir '' +# BOX_PRIVATE_BEGIN +# In unofficial tarballs, made from svn, distribution files are still in +# distribution/boxbackup, so the following line overrides the default above: +# (this section will be removed automatically from distribution tarballs +# by infrastructure/makedistribution.pl) +%define distribution_dir distribution/boxbackup/ +# BOX_PRIVATE_END # Detect distribution. So far we only special-case SUSE. If you need to make # any distro specific changes to get the package building on your system @@ -28,7 +35,7 @@ Summary: An automatic on-line backup system for UNIX. Name: boxbackup -Version: 0.11rc2 +Version: ###DISTRIBUTION-VERSION-NUMBER### Release: 1 License: BSD Group: Applications/Archiving diff --git a/contrib/suse/bbackupd b/contrib/suse/bbackupd deleted file mode 100755 index 30605185..00000000 --- a/contrib/suse/bbackupd +++ /dev/null @@ -1,103 +0,0 @@ -#!/bin/sh -# -# Copyright (c)2004, Nothing But Net Limited -# <chris.smith@nothingbutnet.co.nz> -# -###################################################################### -# RELEASED AND PROVIDED TO YOU UNDER THE SAME LICENCE AS THE BOXBACKUP -# SUITE OF PROGRAMS. LICENCE MAY BE VIEWED HERE: -# -# http://www.boxbackup.org/license.html -###################################################################### -# -# /etc/init.d/bbackupd -# and its symbolic link -# /(usr/)sbin/rcbbackupd -# -### BEGIN INIT INFO -# Provides: bbackupd -# Required-Start: $named $network $local_fs $syslog -# X-UnitedLinux-Should-Start: $time ypbind sendmail -# Required-Stop: $named $network $localfs $syslog -# X-UnitedLinux-Should-Stop: $time ypbind sendmail -# Default-Start: 3 5 -# Default-Stop: 0 1 2 6 -# Short-Description: BoxBackup client side daemon -# Description: Client daemon for the BoxBackup software -# that allows you to communicate with a bbstored server. -### END INIT INFO - -# Check for missing binaries (stale symlinks should not happen) -BBACKUPD_BIN=/usr/local/bin/bbackupd -if [ ! -x $BBACKUPD_BIN ] ; then - echo "$BBACKUPD_BIN not installed" - exit 5 -fi - -. /etc/rc.status - -# Reset status of this service -rc_reset - -case "$1" in - start) - echo -n "Starting bbackupd " - startproc $BBACKUPD_BIN - rc_status -v - ;; - - stop) - echo -n "Shutting down bbackupd " - killproc -TERM $BBACKUPD_BIN - rc_status -v - ;; - - try-restart|condrestart) - if test "$1" = "condrestart"; then - echo "${attn} Use try-restart ${done}(LSB)${attn} rather than condrestart ${warn}(RH)${norm}" - fi - $0 status - if test $? = 0; then - $0 restart - else - rc_reset # Not running is not a failure. - fi - rc_status - ;; - - restart) - $0 stop - $0 start - rc_status - ;; - - force-reload) - echo -n "Reload service bbackupd " - killproc -HUP $BBACKUPD_BIN - rc_status -v - ;; - - reload) - echo -n "Reload service bbackupd " - killproc -HUP $BBACKUPD_BIN - rc_status -v - ;; - - status) - echo -n "Checking for service bbackupd " - checkproc $BBACKUPD_BIN - rc_status -v - ;; - - probe) - test /etc/box/bbackupd.conf \ - -nt /var/run/bbackupd.pid \ - && echo reload - ;; - - *) - echo "Usage: $0 {start|stop|status|try-restart|restart|force-reload|reload|probe}" - exit 1 - -esac -rc_exit diff --git a/contrib/suse/bbstored b/contrib/suse/bbstored deleted file mode 100755 index d0d8b068..00000000 --- a/contrib/suse/bbstored +++ /dev/null @@ -1,104 +0,0 @@ -#!/bin/sh -# -# Copyright (c)2004, Nothing But Net Limited -# <chris.smith@nothingbutnet.co.nz> -# -###################################################################### -# RELEASED AND PROVIDED TO YOU UNDER THE SAME LICENCE AS THE BOXBACKUP -# SUITE OF PROGRAMS. LICENCE MAY BE VIEWED HERE: -# -# http://www.boxbackup.org/license.html -###################################################################### -# -# /etc/init.d/bbstored -# and its symbolic link -# /(usr/)sbin/rcbbstored -# -### BEGIN INIT INFO -# Provides: bbstored -# Required-Start: $named $network $local_fs $syslog -# X-UnitedLinux-Should-Start: $time ypbind sendmail -# Required-Stop: $named $network $localfs $syslog -# X-UnitedLinux-Should-Stop: $time ypbind sendmail -# Default-Start: 3 5 -# Default-Stop: 0 1 2 6 -# Short-Description: BoxBackup server side daemon -# Description: Server daemon for the BoxBackup software, -# to which bbackupd clients connect. -### END INIT INFO -# - -# Check for missing binaries (stale symlinks should not happen) -BBSTORED_BIN=/usr/local/bin/bbstored -if [ ! -x $BBSTORED_BIN ] ; then - echo "$BBSTORED_BIN not installed" - exit 5 -fi - -. /etc/rc.status - -# Reset status of this service -rc_reset - -case "$1" in - start) - echo -n "Starting bbstored " - startproc $BBSTORED_BIN - rc_status -v - ;; - - stop) - echo -n "Shutting down bbstored " - killproc -TERM $BBSTORED_BIN - rc_status -v - ;; - - try-restart|condrestart) - if test "$1" = "condrestart"; then - echo "${attn} Use try-restart ${done}(LSB)${attn} rather than condrestart ${warn}(RH)${norm}" - fi - $0 status - if test $? = 0; then - $0 restart - else - rc_reset # Not running is not a failure. - fi - rc_status - ;; - - restart) - $0 stop - $0 start - rc_status - ;; - - force-reload) - echo -n "Reload service bbstored " - killproc -HUP $BBSTORED_BIN - rc_status -v - ;; - - reload) - echo -n "Reload service bbstored " - killproc -HUP $BBSTORED_BIN - rc_status -v - ;; - - status) - echo -n "Checking for service bbstored " - checkproc $BBSTORED_BIN - rc_status -v - ;; - - probe) - test /etc/box/bbstored.conf \ - -nt /var/run/bbstored.pid && echo reload - ;; - - *) - echo "Usage: $0 {start|stop|status|try-restart|restart|force-reload|reload|probe}" - exit 1 - ;; - -esac -rc_exit |