]> git.sur5r.net Git - bacula/bacula/commitdiff
add openbsd platform support
authorKern Sibbald <kern@sibbald.com>
Fri, 1 Nov 2002 13:36:57 +0000 (13:36 +0000)
committerKern Sibbald <kern@sibbald.com>
Fri, 1 Nov 2002 13:36:57 +0000 (13:36 +0000)
git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@182 91ce42f0-d328-0410-95d8-f526ca767f89

bacula/autoconf/configure.in
bacula/configure
bacula/platforms/openbsd/Makefile.in [new file with mode: 0644]
bacula/platforms/openbsd/bacula-dir.in [new file with mode: 0755]
bacula/platforms/openbsd/bacula-fd.in [new file with mode: 0755]
bacula/platforms/openbsd/bacula-sd.in [new file with mode: 0755]

index 4e8bae92a8c30f23d337dc3479157c88751e266a..95ec062a7021db4ef40accf5e28988ae04738d94 100644 (file)
@@ -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 |\
index 3fc68069260cdb4444a66179ca735699bff4cc02..294fddec3eac66e77b2ce586b2ef30cd7b9825e5 100755 (executable)
@@ -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 (file)
index 0000000..bb7169a
--- /dev/null
@@ -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 (executable)
index 0000000..8ff0919
--- /dev/null
@@ -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 (executable)
index 0000000..9f26ade
--- /dev/null
@@ -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 (executable)
index 0000000..79e1a91
--- /dev/null
@@ -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