From: Kern Sibbald Date: Fri, 1 Nov 2002 13:36:57 +0000 (+0000) Subject: add openbsd platform support X-Git-Tag: Release-1.27~36 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=df4cfe20e3b1933280bd42bbf61313bf4a641671;p=bacula%2Fbacula add openbsd platform support git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@182 91ce42f0-d328-0410-95d8-f526ca767f89 --- diff --git a/bacula/autoconf/configure.in b/bacula/autoconf/configure.in index 4e8bae92a8..95ec062a70 100644 --- a/bacula/autoconf/configure.in +++ b/bacula/autoconf/configure.in @@ -1130,6 +1130,11 @@ openbsd) PSCMD="ps -a -o pid,command" PTHREAD_LIB="-pthread" CFLAGS="${CFLAGS} -pthread" + PFILES="${PFILES} \ + platforms/openbsd/Makefile \ + platforms/openbsd/bacula-fd \ + platforms/openbsd/bacula-sd \ + platforms/openbsd/bacula-dir" ;; redhat) DISTVER=`cat /etc/redhat-release | grep release |\ diff --git a/bacula/configure b/bacula/configure index 3fc6806926..294fddec3e 100755 --- a/bacula/configure +++ b/bacula/configure @@ -9320,6 +9320,11 @@ openbsd) PSCMD="ps -a -o pid,command" PTHREAD_LIB="-pthread" CFLAGS="${CFLAGS} -pthread" + PFILES="${PFILES} \ + platforms/openbsd/Makefile \ + platforms/openbsd/bacula-fd \ + platforms/openbsd/bacula-sd \ + platforms/openbsd/bacula-dir" ;; redhat) DISTVER=`cat /etc/redhat-release | grep release |\ diff --git a/bacula/platforms/openbsd/Makefile.in b/bacula/platforms/openbsd/Makefile.in new file mode 100644 index 0000000000..bb7169aa11 --- /dev/null +++ b/bacula/platforms/openbsd/Makefile.in @@ -0,0 +1,135 @@ +# +# This file is used as the template to create the +# Makefile for the Solaris specific installation. +# +# 15 November 2001 -- Kern Sibbald +# +# for Bacula release @VERSION@ (@DATE@) -- @DISTNAME@ +# + +VPATH = @srcdir@ +INSTALL = @INSTALL@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +SED = /usr/bin/sed + +nothing: + +install: install-autostart + +install-autostart: install-autostart-fd install-autostart-sd install-autostart-dir + + +install-autostart-fd: + @echo "FreeBSD platform installation" + $(INSTALL_PROGRAM) -m 744 bacula-fd /etc/rc.bacula-fd + @-today="`date +%Y%m%d%H%M`"; \ + grep -q /etc/rc.bacula-fd /etc/rc.local; \ + if [ $$? -eq 0 ]; then \ + echo "/etc/rc.local already patched"; \ + else \ + rm -f /etc/rc.local.$$today; \ + cp -p /etc/rc.local /etc/rc.local.$$today; \ + ( echo "Start the Bacula File daemon. Do not remove the 'TAG_BACULA_FD' text"; \ + echo "if [ -x /etc/rc.bacula-fd ]; then # TAG_BACULA_FD"; \ + echo " /etc/rc.bacula-fd start # TAG_BACULA_FD"; \ + echo "fi # TAG_BACULA_FD"; \ + ) >> /etc/rc.local; \ + echo ""; \ + fi + + +install-autostart-sd: + @echo "FreeBSD platform installation" + $(INSTALL_PROGRAM) -m 744 bacula-sd /etc/rc.bacula-sd + @-today="`date +%Y%m%d%H%M`"; \ + grep -q /etc/rc.bacula-sd /etc/rc.local; \ + if [ $$? -eq 0 ]; then \ + echo "/etc/rc.local already patched"; \ + else \ + rm -f /etc/rc.local.$$today; \ + cp -p /etc/rc.local /etc/rc.local.$$today; \ + ( echo "Start the Bacula Storage daemon. Do not remove the 'TAG_BACULA_SD' text"; \ + echo "if [ -x /etc/rc.bacula-fd ]; then # TAG_BACULA_SD"; \ + echo " /etc/rc.bacula-fd start # TAG_BACULA_SD"; \ + echo "fi # TAG_BACULA_SD"; \ + ) >> /etc/rc.local; \ + echo ""; \ + fi + +install-autostart-dir: + @echo "FreeBSD platform installation" + $(INSTALL_PROGRAM) -m 744 bacula-dir /etc/rc.bacula-dir + @-today="`date +%Y%m%d%H%M`"; \ + grep -q /etc/rc.bacula-dir /etc/rc.local; \ + if [ $$? -eq 0 ]; then \ + echo "/etc/rc.local already patched"; \ + else \ + rm -f /etc/rc.local.$$today; \ + cp -p /etc/rc.local /etc/rc.local.$$today; \ + ( echo "Start the Bacula Director. Do not remove the 'TAG_BACULA_DIR' text"; \ + echo "if [ -x /etc/rc.bacula-dir ]; then # TAG_BACULA_DIR"; \ + echo " /etc/rc.bacula-dir start # TAG_BACULA_DIR"; \ + echo "fi # TAG_BACULA_DIR"; \ + ) >> /etc/rc.local; \ + echo ""; \ + fi + + +uninstall: uninstall-autostart + +uninstall-autostart: uninstall-autostart-fd uninstall-autostart-sd uninstall-autostart-dir + +uninstall-autostart-fd: + @echo "FreeBSD platform uninstall" + rm -f /etc/rc.bacula-fd + @-today="`date +%Y%m%d%H%M`"; \ + for f in /etc/rc.local ; do \ + grep -q '# TAG_BACULA_FD' $$f; \ + if [ $$? -eq 0 ]; then \ + echo "removing Bacula lines from $$f"; \ + rm -f $$f.$$today; \ + cp -p $$f $$f.$$today; \ + $(SED) -e '/TAG_BACULA_FD/d;' \ + < $$f.$$today > $$f; \ + chmod 644 $$f; \ + fi; \ + done + + +uninstall-autostart-sd: + @echo "FreeBSD platform uninstall" + rm -f /etc/rc.bacula-sd + @-today="`date +%Y%m%d%H%M`"; \ + for f in /etc/rc.local ; do \ + grep -q '# TAG_BACULA_SD' $$f; \ + if [ $$? -eq 0 ]; then \ + echo "removing Bacula lines from $$f"; \ + rm -f $$f.$$today; \ + cp -p $$f $$f.$$today; \ + $(SED) -e '/TAG_BACULA_SD/d;' \ + < $$f.$$today > $$f; \ + chmod 644 $$f; \ + fi; \ + done + +uninstall-autostart-dir: + @echo "FreeBSD platform uninstall" + rm -f /etc/rc.bacula-dir + @-today="`date +%Y%m%d%H%M`"; \ + for f in /etc/rc.local ; do \ + grep -q '# TAG_BACULA_DIR' $$f; \ + if [ $$? -eq 0 ]; then \ + echo "removing Bacula lines from $$f"; \ + rm -f $$f.$$today; \ + cp -p $$f $$f.$$today; \ + $(SED) -e '/TAG_BACULA_DIR/d;' \ + < $$f.$$today > $$f; \ + chmod 644 $$f; \ + fi; \ + done + +clean: + @rm -f bacula-sd bacula-fd bacula-dir + +distclean: clean + @rm -f Makefile bacula-*.spec diff --git a/bacula/platforms/openbsd/bacula-dir.in b/bacula/platforms/openbsd/bacula-dir.in new file mode 100755 index 0000000000..8ff091906e --- /dev/null +++ b/bacula/platforms/openbsd/bacula-dir.in @@ -0,0 +1,38 @@ +#! /bin/sh +# +# bacula This shell script takes care of starting and stopping +# the bacula Director daemon +# +# chkconfig: 2345 20 99 +# description: It comes by night and sucks the vital essence from your computers. +# +# For Bacula release @VERSION@ (@DATE@) -- @DISTNAME@ +# + +RETVAL=0 +case "$1" in + start) + echo "Starting the Bacula Director: " + @sbindir@/bacula-dir $2 -c @sysconfdir@/bacula-dir.conf + RETVAL=$? + echo + [ $RETVAL -eq 0 ] && touch @subsysdir@/bacula-dir + ;; + stop) + echo "Stopping the Director daemon: " +# killproc @sbindir@/bacula-dir + RETVAL=$? + echo + [ $RETVAL -eq 0 ] && rm -f @subsysdir@/bacula-dir + ;; + restart) + $0 stop + sleep 5 + $0 start + ;; + *) + echo "Usage: $0 {start|stop|restart}" + exit 1 + ;; +esac +exit 0 diff --git a/bacula/platforms/openbsd/bacula-fd.in b/bacula/platforms/openbsd/bacula-fd.in new file mode 100755 index 0000000000..9f26adea5d --- /dev/null +++ b/bacula/platforms/openbsd/bacula-fd.in @@ -0,0 +1,37 @@ +#! /bin/sh +# +# bacula This shell script takes care of starting and stopping +# the bacula File daemon. +# +# chkconfig: 2345 20 99 +# description: It comes by night and sucks the vital essence from your computers. +# +# For Bacula release @VERSION@ (@DATE@) -- @DISTNAME@ +# + +case "$1" in + start) + echo "Starting the Bacula File daemon: " + @sbindir@/bacula-fd $2 -c @sysconfdir@/bacula-fd.conf + RETVAL=$? + echo + [ $RETVAL -eq 0 ] && touch @subsysdir@/bacula-fd + ;; + stop) + echo "Stopping the Bacula File daemon: " +# killproc @sbindir@/bacula-fd + RETVAL=$? + echo + [ $RETVAL -eq 0 ] && rm -f @subsysdir@/bacula-fd + ;; + restart) + $0 stop + sleep 5 + $0 start + ;; + *) + echo "Usage: $0 {start|stop|restart}" + exit 1 + ;; +esac +exit 0 diff --git a/bacula/platforms/openbsd/bacula-sd.in b/bacula/platforms/openbsd/bacula-sd.in new file mode 100755 index 0000000000..79e1a91ee6 --- /dev/null +++ b/bacula/platforms/openbsd/bacula-sd.in @@ -0,0 +1,37 @@ +#! /bin/sh +# +# bacula This shell script takes care of starting and stopping +# the bacula Storage daemon. +# +# chkconfig: 2345 20 99 +# description: It comes by night and sucks the vital essence from your computers. +# +# For Bacula release @VERSION@ (@DATE@) -- @DISTNAME@ +# + +case "$1" in + start) + echo "Starting the Bacula Storage daemon: " + @sbindir@/bacula-sd $2 -c @sysconfdir@/bacula-sd.conf + RETVAL=$? + echo + [ $RETVAL -eq 0 ] && touch @subsysdir@/bacula-sd + ;; + stop) + echo "Stopping the Bacula Storage daemon: " +# killproc @sbindir@/bacula-sd + RETVAL=$? + echo + [ $RETVAL -eq 0 ] && rm -f @subsysdir@/bacula-sd + ;; + restart) + $0 stop + sleep 5 + $0 start + ;; + *) + echo "Usage: $0 {start|stop|restart}" + exit 1 + ;; +esac +exit 0