From: Kern Sibbald Date: Wed, 24 Jun 2015 10:30:10 +0000 (+0200) Subject: Backport copyright changes X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=7c9e7cce294af5394516d46f4938290f7a6a00a1;p=bacula%2Fbacula Backport copyright changes --- diff --git a/bacula/Makefile.in b/bacula/Makefile.in index 6e2990630b..57ef3fbb28 100755 --- a/bacula/Makefile.in +++ b/bacula/Makefile.in @@ -1,3 +1,4 @@ +# # Master Makefile # # Author: Kern Sibbald, Copyright 2000-2015 @@ -12,8 +13,8 @@ dir_user=@dir_user@ srcdir = @srcdir@ VPATH = @srcdir@ .PATH: @srcdir@ -topdir = . -thisdir = . +topdir = @BUILD_DIR@ +thisdir = @BUILD_DIR@ first_rule: all @@ -53,7 +54,7 @@ depend: @for I in ${all_subdirs}; \ do (cd $$I; echo "==>Entering directory `pwd`"; $(MAKE) DESTDIR=$(DESTDIR) $@ || exit 1); done -bacula-fd: Makefile +bacula-fd: Makefile @for I in ${fd_subdirs}; \ do (cd $$I; echo "==>Entering directory `pwd`"; \ $(MAKE) DESTDIR=$(DESTDIR) all || \ @@ -106,15 +107,19 @@ installdirs: $(MKDIR) $(DESTDIR)$(scriptdir) $(MKDIR) $(DESTDIR)$(docdir) $(MKDIR) $(DESTDIR)$(archivedir) + $(MKDIR) $(DESTDIR)$(bsrdir) + $(MKDIR) $(DESTDIR)${logdir} -if test ! -d $(DESTDIR)$(working_dir) ; then \ $(MKDIR) $(DESTDIR)$(working_dir); \ chmod 770 $(DESTDIR)$(working_dir); \ fi -if test "x$(dir_user)" != "x" ; then \ chown $(dir_user) $(DESTDIR)$(working_dir); \ + chown $(dir_user) $(DESTDIR)$(logdir); \ fi -if test "x$(dir_group)" != "x" ; then \ chgrp $(dir_group) $(DESTDIR)$(working_dir); \ + chgrp $(dir_group) $(DESTDIR)$(logdir); \ fi install: installdirs @@ -125,16 +130,16 @@ uninstall: @for I in $(all_subdirs); do (cd $$I && $(MAKE) DESTDIR=$(DESTDIR) $@ || exit 1); done install-autostart: - (cd platforms && $(MAKE) DESTDIR=$(DESTDIR) $@ || exit 1) + (cd platforms && $(MAKE) DESTDIR=$(DESTDIR) $@ || exit 1) install-autostart-dir: - (cd platforms && $(MAKE) DESTDIR=$(DESTDIR) $@ || exit 1) + (cd platforms && $(MAKE) DESTDIR=$(DESTDIR) $@ || exit 1) install-autostart-fd: - (cd platforms && $(MAKE) DESTDIR=$(DESTDIR) $@ || exit 1) + (cd platforms && $(MAKE) DESTDIR=$(DESTDIR) $@ || exit 1) install-autostart-sd: - (cd platforms && $(MAKE) DESTDIR=$(DESTDIR) $@ || exit 1) + (cd platforms && $(MAKE) DESTDIR=$(DESTDIR) $@ || exit 1) uninstall-autostart: (cd platforms && $(MAKE) DESTDIR=$(DESTDIR) $@ || exit 1) @@ -190,7 +195,7 @@ distclean: @$(RMF) bacula fd Makefile startmysql stopmysql startit stopit btraceback @$(RMF) bconsole gconsole @$(RMF) *~ 1 2 3 core core.* config.guess console.log console.sum - @$(RMF) working/* kerns-* + @$(RMF) working/* kerns-* @$(RMF) -rf txt diff src/python src/testprogs @$(RMF) libtool @@ -217,22 +222,4 @@ distcopy: distrib: configure autoconf/config.h.in distdirs distcopy -test: - - -tar.gz: ../$(VERNAME).tar.gz -../$(VERNAME).tar.gz: - (cd ..; tar cvf - $(VERNAME) | gzip -f9 > $(VERNAME).tar.gz) - -tar.Z: ../$(VERNAME).tar.Z -../$(VERNAME).tar.Z: - (cd ..; tar cvf - $(VERNAME) | compress > $(VERNAME).tar.Z) - -tar.bz2: ../$(VERNAME).tar.bz2 -../$(VERNAME).tar.bz2: - (cd ..; tar cvf - $(VERNAME) | bzip2 -f9 > $(VERNAME).tar.bz2) - -uuencode: tar.gz - uuencode ../$(VERNAME).tar.gz $(VERNAME).tar.gz > ../$(VERNAME).tgz.uu - # ------------------------------------------------------------------------ diff --git a/bacula/autoconf/bacula-macros/db.m4 b/bacula/autoconf/bacula-macros/db.m4 index 0f4650cf79..d9d4e1fcf7 100644 --- a/bacula/autoconf/bacula-macros/db.m4 +++ b/bacula/autoconf/bacula-macros/db.m4 @@ -808,7 +808,7 @@ AC_HELP_STRING([--with-sqlite3@<:@=DIR@:>@], [Include SQLite3 support. DIR is th if test "x$support_batch_insert" = "xyes"; then dnl For sqlite checking saved_LDFLAGS="${LDFLAGS}" - LDFLAGS="${saved_LDFLAGS} -L$SQLITE_LIBDIR" + LDFLAGS="${saved_LDFLAGS} -lpthread -L$SQLITE_LIBDIR" AC_CHECK_LIB(sqlite3, sqlite3_threadsafe, AC_DEFINE(HAVE_SQLITE3_THREADSAFE, 1, [Set if have sqlite3_threadsafe])) if test "x$ac_cv_lib_sqlite3_sqlite3_threadsafe" = "xyes"; then diff --git a/bacula/autoconf/config.h.in b/bacula/autoconf/config.h.in index 33b04f1e80..c871a72431 100644 --- a/bacula/autoconf/config.h.in +++ b/bacula/autoconf/config.h.in @@ -2,6 +2,11 @@ /* ------------------------------------------------------------------------- */ /* -- CONFIGURE SPECIFIED FEATURES -- */ /* ------------------------------------------------------------------------- */ + +/* + * Author: Kern Sibbald, 2002-2015 + * License: BSD 2-Clause + */ /* Define if you want to use MySQL as Catalog database */ #undef USE_MYSQL_DB @@ -1080,9 +1085,9 @@ /* If using the C implementation of alloca, define if you know the direction of stack growth for your system; otherwise it will be automatically deduced at runtime. - STACK_DIRECTION > 0 => grows toward higher addresses - STACK_DIRECTION < 0 => grows toward lower addresses - STACK_DIRECTION = 0 => direction of growth unknown */ + STACK_DIRECTION > 0 => grows toward higher addresses + STACK_DIRECTION < 0 => grows toward lower addresses + STACK_DIRECTION = 0 => direction of growth unknown */ #undef STACK_DIRECTION /* Define to 1 if the `S_IS*' macros in do not work properly. */ diff --git a/bacula/autoconf/mkinstalldirs b/bacula/autoconf/mkinstalldirs index 6fbe5e1176..4191a45dbd 100755 --- a/bacula/autoconf/mkinstalldirs +++ b/bacula/autoconf/mkinstalldirs @@ -1,7 +1,7 @@ #! /bin/sh # mkinstalldirs --- make directory hierarchy -scriptversion=2004-02-15.20 +scriptversion=2009-04-28.21; # UTC # Original author: Noah Friedman # Created: 1993-05-16 @@ -11,8 +11,11 @@ scriptversion=2004-02-15.20 # bugs to or send patches to # . +nl=' +' +IFS=" "" $nl" errstatus=0 -dirmode="" +dirmode= usage="\ Usage: mkinstalldirs [-h] [--help] [--version] [-m MODE] DIR ... @@ -27,7 +30,7 @@ while test $# -gt 0 ; do case $1 in -h | --help | --h*) # -h for help echo "$usage" - exit 0 + exit $? ;; -m) # -m PERM arg shift @@ -37,7 +40,7 @@ while test $# -gt 0 ; do ;; --version) echo "$0 $scriptversion" - exit 0 + exit $? ;; --) # stop option processing shift @@ -103,13 +106,21 @@ esac for file do - set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'` + case $file in + /*) pathcomp=/ ;; + *) pathcomp= ;; + esac + oIFS=$IFS + IFS=/ + set fnord $file shift + IFS=$oIFS - pathcomp= for d do - pathcomp="$pathcomp$d" + test "x$d" = x && continue + + pathcomp=$pathcomp$d case $pathcomp in -*) pathcomp=./$pathcomp ;; esac @@ -124,7 +135,7 @@ do else if test ! -z "$dirmode"; then echo "chmod $dirmode $pathcomp" - lasterr="" + lasterr= chmod "$dirmode" "$pathcomp" || lasterr=$? if test ! -z "$lasterr"; then @@ -134,7 +145,7 @@ do fi fi - pathcomp="$pathcomp/" + pathcomp=$pathcomp/ done done @@ -146,5 +157,6 @@ exit $errstatus # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" -# time-stamp-end: "$" +# time-stamp-time-zone: "UTC" +# time-stamp-end: "; # UTC" # End: diff --git a/bacula/examples/nagios/check_bacula/check_bacula.c b/bacula/examples/nagios/check_bacula/check_bacula.c index 1546da7938..db0e22d2b8 100644 --- a/bacula/examples/nagios/check_bacula/check_bacula.c +++ b/bacula/examples/nagios/check_bacula/check_bacula.c @@ -345,7 +345,7 @@ int docmd(monitoritem* item, const char* command, char *answer) { item->D_sock->signal(BNET_HB_RESPONSE); } else { - sprintf(answer, "BACULA WARNING - Unexpected signal received : %s ", bnet_sig_to_ascii(item->D_sock)); + sprintf(answer, "BACULA WARNING - Unexpected signal received : %s ", bnet_sig_to_ascii(item->D_sock->msglen)); } } else { /* BNET_HARDEOF || BNET_ERROR */ diff --git a/bacula/manpages/bacula-tray-monitor.1 b/bacula/manpages/bacula-tray-monitor.1 index 1a62cf3c51..a07cb596ff 100644 --- a/bacula/manpages/bacula-tray-monitor.1 +++ b/bacula/manpages/bacula-tray-monitor.1 @@ -43,4 +43,4 @@ This manual page was written by Jose Luis Tallon .nh . .SH COPYRIGHT -This man page document is released under the LGPL version 3.0 license. +This man page document is released under the BSD 2-Clause license. diff --git a/bacula/manpages/bcopy.8 b/bacula/manpages/bcopy.8 index 47314c6b05..c6aebfe1f6 100644 --- a/bacula/manpages/bcopy.8 +++ b/bacula/manpages/bcopy.8 @@ -8,9 +8,9 @@ .SH NAME bcopy \- Bacula's 'Copy from tape' .SH SYNOPSIS -.B bcopy +.B bcopy .RI [ options ] -.I input-archive +.I input-archive .I output-archive .br .SH DESCRIPTION @@ -19,7 +19,7 @@ This manual page documents briefly the command. .PP .\" TeX users may be more comfortable with the \fB\fP and -.\" \fI\fP escape sequences to invoke bold face and italics, +.\" \fI\fP escape sequences to invoke bold face and italics, .\" respectively. .SH OPTIONS A summary of options is included below. @@ -59,7 +59,7 @@ Set verbose mode. .br .SH AUTHOR This manual page was written by Jose Luis Tallon -.nh +.nh . .SH COPYRIGHT -This man page document is released under the LGPL version 3.0 license. +This man page document is released under the BSD 2-Clause license. diff --git a/bacula/platforms/Makefile.in b/bacula/platforms/Makefile.in index fedcde3cf7..b2e81841d4 100644 --- a/bacula/platforms/Makefile.in +++ b/bacula/platforms/Makefile.in @@ -1,3 +1,5 @@ +# Copyright (C) Kern Sibbald 2001-2015 +# License: BSD 2-Clause # # This is the makefile template for the platform directory # which contains general platform installation. diff --git a/bacula/platforms/aix/Makefile.in b/bacula/platforms/aix/Makefile.in index 3dbee96cc1..91e74c1653 100644 --- a/bacula/platforms/aix/Makefile.in +++ b/bacula/platforms/aix/Makefile.in @@ -3,6 +3,8 @@ # Makefile for the AXI specific installation. # # 1 March 2003 -- Kern Sibbald +# Copyright (C) 2003-2015, Kern Sibbald +# License: BSD 2-Clause # # for Bacula release @VERSION@ (@DATE@) -- @DISTNAME@ # diff --git a/bacula/platforms/alpha/Makefile.in b/bacula/platforms/alpha/Makefile.in index 038615bfc7..803462b040 100644 --- a/bacula/platforms/alpha/Makefile.in +++ b/bacula/platforms/alpha/Makefile.in @@ -1,4 +1,7 @@ # +# Copyright (C) Kern Sibbald 2004-2015 +# License: BSD 2-Clause +# # This file is used as the template to create the # Makefile for the Tru64 specific installation. # diff --git a/bacula/platforms/alpha/bacula-fd.in b/bacula/platforms/alpha/bacula-fd.in index 74a12c00dd..9ea8b23f52 100644 --- a/bacula/platforms/alpha/bacula-fd.in +++ b/bacula/platforms/alpha/bacula-fd.in @@ -1,5 +1,8 @@ #!/bin/sh # +# Copyright (C) Kern Sibbald 2000-2015 +# License: BSD 2-Clause +# # bacula This shell script takes care of starting and stopping # the bacula File daemon. # @@ -9,6 +12,7 @@ # for Bacula release @VERSION@ (@DATE@) -- @DISTNAME@ # +RETVAL=0 case "$1" in start) echo "Starting the Bacula File daemon: " @@ -30,10 +34,11 @@ case "$1" in $0 stop sleep 5 $0 start + RETVAL=$? ;; *) echo "Usage: $0 {start|stop|restart}" exit 1 ;; esac -exit 0 +exit $RETVAL diff --git a/bacula/platforms/bsdi/Makefile.in b/bacula/platforms/bsdi/Makefile.in index 5a84037692..314abc31fa 100644 --- a/bacula/platforms/bsdi/Makefile.in +++ b/bacula/platforms/bsdi/Makefile.in @@ -1,3 +1,6 @@ +# +# Copyright (C) Kern Sibbald 2001-2015 +# License: BSD 2-Clause # # This file is used as the template to create the # Makefile for the Solaris specific installation. diff --git a/bacula/platforms/bsdi/bacula-dir.in b/bacula/platforms/bsdi/bacula-dir.in index af7b0c5c1a..f9667719c1 100755 --- a/bacula/platforms/bsdi/bacula-dir.in +++ b/bacula/platforms/bsdi/bacula-dir.in @@ -1,4 +1,6 @@ #! /bin/sh +# Copyright (C) Kern Sibbald 2000-2015 +# License: BSD 2-Clause # # bacula This shell script takes care of starting and stopping # the bacula Director daemon @@ -29,10 +31,11 @@ case "$1" in $0 stop sleep 5 $0 start + RETVAL=$? ;; *) echo "Usage: $0 {start|stop|restart}" exit 1 ;; esac -exit 0 +exit $RETVAL diff --git a/bacula/platforms/bsdi/bacula-fd.in b/bacula/platforms/bsdi/bacula-fd.in index 2c41b34325..f02b16db7b 100755 --- a/bacula/platforms/bsdi/bacula-fd.in +++ b/bacula/platforms/bsdi/bacula-fd.in @@ -1,5 +1,8 @@ #! /bin/sh # +# Copyright (C) Kern Sibbald 2000-2015 +# License: BSD 2-Clause +# # bacula This shell script takes care of starting and stopping # the bacula File daemon. # @@ -9,6 +12,7 @@ # For Bacula release @VERSION@ (@DATE@) -- @DISTNAME@ # +RETVAL=0 case "$1" in start) echo "Starting the Bacula File daemon: " @@ -28,10 +32,11 @@ case "$1" in $0 stop sleep 5 $0 start + RETVAL=$? ;; *) echo "Usage: $0 {start|stop|restart}" exit 1 ;; esac -exit 0 +exit $RETVAL diff --git a/bacula/platforms/bsdi/bacula-sd.in b/bacula/platforms/bsdi/bacula-sd.in index 9f4e6f0c70..1db2740aa1 100755 --- a/bacula/platforms/bsdi/bacula-sd.in +++ b/bacula/platforms/bsdi/bacula-sd.in @@ -1,5 +1,8 @@ #! /bin/sh # +# Copyright (C) Kern Sibbald 2000-2015 +# License: BSD 2-Clause +# # bacula This shell script takes care of starting and stopping # the bacula Storage daemon. # @@ -9,6 +12,7 @@ # For Bacula release @VERSION@ (@DATE@) -- @DISTNAME@ # +RETVAL=0 case "$1" in start) echo "Starting the Bacula Storage daemon: " @@ -28,10 +32,11 @@ case "$1" in $0 stop sleep 5 $0 start + RETVAL=$? ;; *) echo "Usage: $0 {start|stop|restart}" exit 1 ;; esac -exit 0 +exit $RETVAL diff --git a/bacula/platforms/contrib-rpm/build_rpm.sh b/bacula/platforms/contrib-rpm/build_rpm.sh index 67d82dc7da..ba8675b083 100755 --- a/bacula/platforms/contrib-rpm/build_rpm.sh +++ b/bacula/platforms/contrib-rpm/build_rpm.sh @@ -3,9 +3,10 @@ # shell script to build bacula rpm release # copy this script into a working directory with the src rpm to build and execute # 19 Aug 2006 D. Scott Barninger +# +# Copyright Kern Sibbald 2006-2015 +# License: BSD 2-Clause -# Copyright (C) 2006 Free Software Foundation Europe e.V. -# licensed under GPL-v2 # signing rpms # Make sure you have a .rpmmacros file in your home directory containing the following: @@ -115,10 +116,10 @@ rpmbuild --rebuild --define "build_${PLATFORM} 1" \ rm -rf ${RPMBUILD}/* if [ "$BUILDBAT" = "1" ]; then - echo Building Bat package for "$PLATFORM"... - sleep 2 - rpmbuild --rebuild ${SRPM2} - rm -rf ${RPMBUILD}/* + echo Building Bat package for "$PLATFORM"... + sleep 2 + rpmbuild --rebuild ${SRPM2} + rm -rf ${RPMBUILD}/* fi echo Building Docs package for "$PLATFORM"... @@ -127,10 +128,10 @@ rpmbuild --rebuild ${SRPM3} rm -rf ${RPMBUILD}/* if [ "$BUILDMTX" = "1" ]; then - echo Building mtx package for "$PLATFORM"... - sleep 2 - rpmbuild --rebuild ${SRPM4} - rm -rf ${RPMBUILD}/* + echo Building mtx package for "$PLATFORM"... + sleep 2 + rpmbuild --rebuild ${SRPM4} + rm -rf ${RPMBUILD}/* fi # delete the updatedb package and any debuginfo packages built @@ -153,8 +154,8 @@ mv -f ${RPMDIR}/bacula-sqlite-${VERSION}-${RELEASE}.${ARCH}.rpm \ ./bacula-sqlite-${VERSION}-${RELEASE}.${FILENAME}.${ARCH}.rpm if [ "$BUILDMTX" = "1" ]; then - mv -f ${RPMDIR}/bacula-mtx-${VERSION}-${RELEASE}.${ARCH}.rpm \ - ./bacula-mtx-${VERSION}-${RELEASE}.${FILENAME}.${ARCH}.rpm + mv -f ${RPMDIR}/bacula-mtx-${VERSION}-${RELEASE}.${ARCH}.rpm \ + ./bacula-mtx-${VERSION}-${RELEASE}.${FILENAME}.${ARCH}.rpm fi mv -f ${RPMDIR}/bacula-client-${VERSION}-${RELEASE}.${ARCH}.rpm \ @@ -164,8 +165,8 @@ mv -f ${RPMDIR}/bacula-libs-${VERSION}-${RELEASE}.${ARCH}.rpm \ ./bacula-libs-${VERSION}-${RELEASE}.${FILENAME}.${ARCH}.rpm if [ "$BUILDBAT" = "1" ]; then - mv -f ${RPMDIR}/bacula-bat-${VERSION}-${RELEASE}.${ARCH}.rpm \ - ./bacula-bat-${VERSION}-${RELEASE}.${FILENAME}.${ARCH}.rpm + mv -f ${RPMDIR}/bacula-bat-${VERSION}-${RELEASE}.${ARCH}.rpm \ + ./bacula-bat-${VERSION}-${RELEASE}.${FILENAME}.${ARCH}.rpm fi mv -f ${RPMDIR2}/bacula-docs-${VERSION}-${RELEASE}.noarch.rpm . diff --git a/bacula/platforms/contrib-rpm/rpm_wizard.sh b/bacula/platforms/contrib-rpm/rpm_wizard.sh index 89857dc623..b2ceb9bf85 100755 --- a/bacula/platforms/contrib-rpm/rpm_wizard.sh +++ b/bacula/platforms/contrib-rpm/rpm_wizard.sh @@ -3,9 +3,10 @@ # shell script wizard to build bacula rpm using gnome dialogs # requires zenity to be installed # 30 Jul 2006 D. Scott Barninger +# +# Copyright Kern Sibbald 2006-2015 +# License: BSD 2-Clause -# Copyright (C) 2006 Free Software Foundation Europe e.V. -# licensed under GPL-v2 # usage ./rpm_wizard.sh diff --git a/bacula/platforms/contrib-rpm/rpmkey.spec b/bacula/platforms/contrib-rpm/rpmkey.spec index 81183a1abb..bde76244cc 100644 --- a/bacula/platforms/contrib-rpm/rpmkey.spec +++ b/bacula/platforms/contrib-rpm/rpmkey.spec @@ -1,6 +1,7 @@ # rpm public key package -# Copyright (C) 2006 Free Software Foundation Europe e.V. # +# Copyright Kern Sibbald 2000-2015 +# License: BSD 2-Clause # # replace the string yournam with your name @@ -14,7 +15,7 @@ Summary: The %{pubkeyname} rpm public key Name: rpmkey-%{pubkeyname} Version: 0.1 Release: 1 -License: GPL v2 +License: BSD 2-Clause Group: System/Packages Source0: %{pubkeyname}.asc BuildArch: noarch diff --git a/bacula/platforms/darwin/Makefile.in b/bacula/platforms/darwin/Makefile.in index c6fde3ee46..f6eef7a8b7 100644 --- a/bacula/platforms/darwin/Makefile.in +++ b/bacula/platforms/darwin/Makefile.in @@ -1,4 +1,7 @@ # +# Copyright (C) Kern Sibbald 2003-2015 +# License: BSD 2-Clause +# # This file is used as the template to create the # Makefile for the Darwin specific installation. # diff --git a/bacula/platforms/debian/Makefile.in b/bacula/platforms/debian/Makefile.in index aa77f36013..77533d76a2 100644 --- a/bacula/platforms/debian/Makefile.in +++ b/bacula/platforms/debian/Makefile.in @@ -1,3 +1,6 @@ +# +# Copyright (C) Kern Sibbald 2008-2015 +# License: BSD 2-Clause # # This file is used as the template to create the # Makefile for the Debian/Ubuntu/Kubuntu specific installation. diff --git a/bacula/platforms/debian/bacula-dir.in b/bacula/platforms/debian/bacula-dir.in index 73253dce8e..b02fad6044 100644 --- a/bacula/platforms/debian/bacula-dir.in +++ b/bacula/platforms/debian/bacula-dir.in @@ -1,5 +1,8 @@ #! /bin/sh # +# Copyright (C) Kern Sibbald 2008-2015 +# License: BSD 2-Clause +# # bacula This shell script takes care of starting and stopping # the bacula Director daemon on Debian/Ubuntu/Kubuntu # systems. @@ -48,6 +51,7 @@ if [ "x${BUSER}" != "x" ]; then fi fi +RETVAL=0 case "$1" in start) echo -n "Starting ${DESC}: " @@ -65,6 +69,7 @@ case "$1" in $0 stop sleep 5 $0 start + RETVAL=$? ;; *) echo "Usage: /etc/init.d/${NAME} {start|stop|restart|force-reload}" >&2 diff --git a/bacula/platforms/debian/bacula-fd.in b/bacula/platforms/debian/bacula-fd.in index 181625ce7d..af6b640dd2 100644 --- a/bacula/platforms/debian/bacula-fd.in +++ b/bacula/platforms/debian/bacula-fd.in @@ -1,5 +1,8 @@ #! /bin/sh # +# Copyright (C) Kern Sibbald 2008-2015 +# License: BSD 2-Clause +# # bacula This shell script takes care of starting and stopping # the bacula Director daemon on Debian/Ubuntu/Kubuntu # systems. @@ -48,6 +51,7 @@ if [ "x${BUSER}" != "x" ]; then fi fi +RETVAL=0 case "$1" in start) echo -n "Starting ${DESC}: " @@ -65,6 +69,7 @@ case "$1" in $0 stop sleep 5 $0 start + RETVAL=$? ;; *) echo "Usage: /etc/init.d/${NAME} {start|stop|restart|force-reload}" >&2 diff --git a/bacula/platforms/debian/bacula-sd.in b/bacula/platforms/debian/bacula-sd.in index 1753304755..7c61610057 100644 --- a/bacula/platforms/debian/bacula-sd.in +++ b/bacula/platforms/debian/bacula-sd.in @@ -1,5 +1,8 @@ #! /bin/sh # +# Copyright (C) Kern Sibbald 2008-2015 +# License: BSD 2-Clause +# # bacula This shell script takes care of starting and stopping # the bacula Director daemon on Debian/Ubuntu/Kubuntu # systems. @@ -48,6 +51,7 @@ if [ "x${BUSER}" != "x" ]; then fi fi +RETVAL=0 case "$1" in start) echo -n "Starting ${DESC}: " @@ -65,6 +69,7 @@ case "$1" in $0 stop sleep 5 $0 start + RETVAL=$? ;; *) echo "Usage: /etc/init.d/${NAME} {start|stop|restart|force-reload}" >&2 diff --git a/bacula/platforms/freebsd/Makefile.in b/bacula/platforms/freebsd/Makefile.in index b97f62c803..3911a191bb 100644 --- a/bacula/platforms/freebsd/Makefile.in +++ b/bacula/platforms/freebsd/Makefile.in @@ -1,3 +1,6 @@ +# +# Copyright (C) Kern Sibbald 2001-2015 +# License: BSD 2-Clause # # This file is used as the template to create the # Makefile for the Solaris specific installation. diff --git a/bacula/platforms/freebsd/bacula-dir.in b/bacula/platforms/freebsd/bacula-dir.in index af7b0c5c1a..6f283f0874 100755 --- a/bacula/platforms/freebsd/bacula-dir.in +++ b/bacula/platforms/freebsd/bacula-dir.in @@ -1,5 +1,8 @@ #! /bin/sh # +# Copyright (C) Kern Sibbald 2000-2015 +# License: BSD 2-Clause +# # bacula This shell script takes care of starting and stopping # the bacula Director daemon # @@ -29,10 +32,11 @@ case "$1" in $0 stop sleep 5 $0 start + RETVAL=$? ;; *) echo "Usage: $0 {start|stop|restart}" exit 1 ;; esac -exit 0 +exit $RETVAL diff --git a/bacula/platforms/freebsd/bacula-fd.in b/bacula/platforms/freebsd/bacula-fd.in index 2c41b34325..f02b16db7b 100755 --- a/bacula/platforms/freebsd/bacula-fd.in +++ b/bacula/platforms/freebsd/bacula-fd.in @@ -1,5 +1,8 @@ #! /bin/sh # +# Copyright (C) Kern Sibbald 2000-2015 +# License: BSD 2-Clause +# # bacula This shell script takes care of starting and stopping # the bacula File daemon. # @@ -9,6 +12,7 @@ # For Bacula release @VERSION@ (@DATE@) -- @DISTNAME@ # +RETVAL=0 case "$1" in start) echo "Starting the Bacula File daemon: " @@ -28,10 +32,11 @@ case "$1" in $0 stop sleep 5 $0 start + RETVAL=$? ;; *) echo "Usage: $0 {start|stop|restart}" exit 1 ;; esac -exit 0 +exit $RETVAL diff --git a/bacula/platforms/freebsd/bacula-sd.in b/bacula/platforms/freebsd/bacula-sd.in index 9f4e6f0c70..1db2740aa1 100755 --- a/bacula/platforms/freebsd/bacula-sd.in +++ b/bacula/platforms/freebsd/bacula-sd.in @@ -1,5 +1,8 @@ #! /bin/sh # +# Copyright (C) Kern Sibbald 2000-2015 +# License: BSD 2-Clause +# # bacula This shell script takes care of starting and stopping # the bacula Storage daemon. # @@ -9,6 +12,7 @@ # For Bacula release @VERSION@ (@DATE@) -- @DISTNAME@ # +RETVAL=0 case "$1" in start) echo "Starting the Bacula Storage daemon: " @@ -28,10 +32,11 @@ case "$1" in $0 stop sleep 5 $0 start + RETVAL=$? ;; *) echo "Usage: $0 {start|stop|restart}" exit 1 ;; esac -exit 0 +exit $RETVAL diff --git a/bacula/platforms/gentoo/Makefile.in b/bacula/platforms/gentoo/Makefile.in index 4c7c9b0250..d07beb0d82 100644 --- a/bacula/platforms/gentoo/Makefile.in +++ b/bacula/platforms/gentoo/Makefile.in @@ -1,4 +1,7 @@ -# +# +# Copyright (C) Kern Sibbald 2003-2015 +# License: BSD 2-Clause +# # This file is used as the template to create the # Makefile for the Gentoo specific installation. # diff --git a/bacula/platforms/gentoo/bacula-dir.in b/bacula/platforms/gentoo/bacula-dir.in index a4cbca733d..f62574f394 100755 --- a/bacula/platforms/gentoo/bacula-dir.in +++ b/bacula/platforms/gentoo/bacula-dir.in @@ -1,5 +1,8 @@ #!/sbin/runscript # +# Copyright (C) Kern Sibbald 2000-2015 +# License: BSD 2-Clause +# # bacula This shell script takes care of starting and stopping # the bacula Director daemon for the Gentoo release # diff --git a/bacula/platforms/gentoo/bacula-fd.in b/bacula/platforms/gentoo/bacula-fd.in index 98e5efeb36..8248e37298 100755 --- a/bacula/platforms/gentoo/bacula-fd.in +++ b/bacula/platforms/gentoo/bacula-fd.in @@ -1,5 +1,8 @@ #!/sbin/runscript # +# Copyright (C) Kern Sibbald 2000-2015 +# License: BSD 2-Clause +# # bacula This shell script takes care of starting and stopping # the bacula File daemon for the Gentoo release. # diff --git a/bacula/platforms/gentoo/bacula-sd.in b/bacula/platforms/gentoo/bacula-sd.in index 26c6f74566..44184ae9a3 100755 --- a/bacula/platforms/gentoo/bacula-sd.in +++ b/bacula/platforms/gentoo/bacula-sd.in @@ -1,5 +1,8 @@ #!/sbin/runscript # +# Copyright (C) Kern Sibbald 2000-2015 +# License: BSD 2-Clause +# # bacula This shell script takes care of starting and stopping # the bacula Storage daemon for the Gentoo release. # diff --git a/bacula/platforms/gentoo/bacula.ebuild b/bacula/platforms/gentoo/bacula.ebuild index b87c6248f4..ef70d471cd 100644 --- a/bacula/platforms/gentoo/bacula.ebuild +++ b/bacula/platforms/gentoo/bacula.ebuild @@ -1,5 +1,7 @@ # Copyright 2004 D. Scott Barninger -# Distributed under the terms of the GNU General Public License v2 +# Copyright Kern Sibbald 2004-2015 +# License: BSD 2-Clause +# # # Modified from bacula-1.34.5.ebuild for 1.36.0 release # 24 Oct 2004 D. Scott Barninger @@ -37,7 +39,7 @@ DESCRIPTION="featureful client/server network backup suite" HOMEPAGE="http://www.bacula.org/" SRC_URI="mirror://sourceforge/bacula/${P}.tar.gz" -LICENSE="GPL-2" +LICENSE="BSD 2-Clause" SLOT="0" KEYWORDS="x86 ~ppc ~sparc ~amd64" IUSE="readline tcpd gnome mysql sqlite X static postgres wxwindows bacula-clientonly bacula-split" @@ -48,379 +50,379 @@ inherit eutils # mysql is the recommended choice ... # may need sys-libs/libtermcap-compat but try without first DEPEND=">=sys-libs/zlib-1.1.4 - readline? ( >=sys-libs/readline-4.1 ) - tcpd? ( >=sys-apps/tcp-wrappers-7.6 ) - gnome? ( gnome-base/libgnome ) - gnome? ( app-admin/gnomesu ) - !bacula-clientonly? ( - sqlite? ( =dev-db/sqlite-2* ) - mysql? ( >=dev-db/mysql-3.23 ) - postgres? ( >=dev-db/postgresql-7.4.0 ) - sys-apps/mtx - ) - X? ( virtual/x11 ) - wxwindows? ( >=x11-libs/wxGTK-2.4.2 ) - virtual/mta - dev-libs/gmp - app-text/tetex - dev-tex/latex2html" + readline? ( >=sys-libs/readline-4.1 ) + tcpd? ( >=sys-apps/tcp-wrappers-7.6 ) + gnome? ( gnome-base/libgnome ) + gnome? ( app-admin/gnomesu ) + !bacula-clientonly? ( + sqlite? ( =dev-db/sqlite-2* ) + mysql? ( >=dev-db/mysql-3.23 ) + postgres? ( >=dev-db/postgresql-7.4.0 ) + sys-apps/mtx + ) + X? ( virtual/x11 ) + wxwindows? ( >=x11-libs/wxGTK-2.4.2 ) + virtual/mta + dev-libs/gmp + app-text/tetex + dev-tex/latex2html" RDEPEND="${DEPEND} - !bacula-clientonly? ( - sys-apps/mtx - app-arch/mt-st - )" + !bacula-clientonly? ( + sys-apps/mtx + app-arch/mt-st + )" src_compile() { - # this resolves bug #181 - epatch ${FILESDIR}/1.36.2-cdrecord-configure.patch - - local myconf="" - - myconf=" - `use_enable readline` - `use_enable gnome` - `use_enable tcpd tcp-wrappers` - `use_enable X x`" - - # define this to skip building the other daemons ... - if use bacula-clientonly - then - myconf="${myconf} --enable-client-only" - fi - - # select database support - if ! use bacula-clientonly - then - # mysql is the recomended choice ... - if use mysql - then - myconf="${myconf} --with-mysql=/usr" - elif use postgres - then - myconf="${myconf} --with-postgresql=/usr" - elif use sqlite - then - myconf="${myconf} --with-sqlite=/usr" - elif use sqlite && use mysql - then - myconf="${myconf/--with-sqlite/}" - fi - fi - - if use wxwindows - then - myconf="${myconf} --enable-wx-console" - fi - - if use readline - then - myconf="${myconf} --enable-readline" - fi - - if use gnome - then - myconf="${myconf} --enable-tray-monitor" - fi - - ./configure \ - --enable-smartalloc \ - --prefix=/usr \ - --mandir=/usr/share/man \ - --with-pid-dir=/var/run \ - --sysconfdir=/etc/bacula \ - --infodir=/usr/share/info \ - --with-subsys-dir=/var/lock/subsys \ - --with-working-dir=/var/bacula \ - --with-scriptdir=/etc/bacula \ - --with-dir-user=root \ - --with-dir-group=bacula \ - --with-sd-user=root \ - --with-sd-group=bacula \ - --with-fd-user=root \ - --with-fd-group=bacula \ - --host=${CHOST} ${myconf} || die "bad ./configure" - - emake || die "compile problem" - - # for the rescue package regardless of use static - cd ${S}/src/filed - make static-bacula-fd - cd ${S} - - # make the docs - cd ${S}/doc/latex - make - cd ${S} - - if use static - then - cd ${S}/src/console - make static-console - cd ${S}/src/dird - make static-bacula-dir - if use gnome - then - cd ${S}/src/gnome-console - make static-gnome-console - fi - if use wxwindows - then - cd ${S}/src/wx-console - make static-wx-console - fi - cd ${S}/src/stored - make static-bacula-sd - fi + # this resolves bug #181 + epatch ${FILESDIR}/1.36.2-cdrecord-configure.patch + + local myconf="" + + myconf=" + `use_enable readline` + `use_enable gnome` + `use_enable tcpd tcp-wrappers` + `use_enable X x`" + + # define this to skip building the other daemons ... + if use bacula-clientonly + then + myconf="${myconf} --enable-client-only" + fi + + # select database support + if ! use bacula-clientonly + then + # mysql is the recomended choice ... + if use mysql + then + myconf="${myconf} --with-mysql=/usr" + elif use postgres + then + myconf="${myconf} --with-postgresql=/usr" + elif use sqlite + then + myconf="${myconf} --with-sqlite=/usr" + elif use sqlite && use mysql + then + myconf="${myconf/--with-sqlite/}" + fi + fi + + if use wxwindows + then + myconf="${myconf} --enable-wx-console" + fi + + if use readline + then + myconf="${myconf} --enable-readline" + fi + + if use gnome + then + myconf="${myconf} --enable-tray-monitor" + fi + + ./configure \ + --enable-smartalloc \ + --prefix=/usr \ + --mandir=/usr/share/man \ + --with-pid-dir=/var/run \ + --sysconfdir=/etc/bacula \ + --infodir=/usr/share/info \ + --with-subsys-dir=/var/lock/subsys \ + --with-working-dir=/var/bacula \ + --with-scriptdir=/etc/bacula \ + --with-dir-user=root \ + --with-dir-group=bacula \ + --with-sd-user=root \ + --with-sd-group=bacula \ + --with-fd-user=root \ + --with-fd-group=bacula \ + --host=${CHOST} ${myconf} || die "bad ./configure" + + emake || die "compile problem" + + # for the rescue package regardless of use static + cd ${S}/src/filed + make static-bacula-fd + cd ${S} + + # make the docs + cd ${S}/doc/latex + make + cd ${S} + + if use static + then + cd ${S}/src/console + make static-console + cd ${S}/src/dird + make static-bacula-dir + if use gnome + then + cd ${S}/src/gnome-console + make static-gnome-console + fi + if use wxwindows + then + cd ${S}/src/wx-console + make static-wx-console + fi + cd ${S}/src/stored + make static-bacula-sd + fi } src_install() { - make DESTDIR=${D} install || die - - if use static - then - cd ${S}/src/filed - cp static-bacula-fd ${D}/usr/sbin/bacula-fd - cd ${S}/src/console - cp static-console ${D}/usr/sbin/console - cd ${S}/src/dird - cp static-bacula-dir ${D}/usr/sbin/bacula-dir - if use gnome - then - cd ${S}/src/gnome-console - cp static-gnome-console ${D}/usr/sbin/gnome-console - fi - if use wxwindows - then - cd ${S}/src/wx-console - cp static-wx-console ${D}/usr/sbin/wx-console - fi - cd ${S}/src/stored - cp static-bacula-sd ${D}/usr/sbin/bacula-sd - fi - - # the menu stuff - if use gnome - then - mkdir -p ${D}/usr/share/pixmaps - mkdir -p ${D}/usr/share/applications - cp ${S}/scripts/bacula.png ${D}/usr/share/pixmaps/bacula.png - cp ${S}/scripts/bacula.desktop.gnome2.xsu ${D}/usr/share/applications/bacula.desktop - cp ${S}/src/tray-monitor/generic.xpm ${D}/usr/share/pixmaps/bacula-tray-monitor.xpm - cp ${S}/scripts/bacula-tray-monitor.desktop \ - ${D}/usr/share/applications/bacula-tray-monitor.desktop - chmod 755 ${D}/usr/sbin/bacula-tray-monitor - chmod 644 ${D}/etc/bacula/tray-monitor.conf - fi - - if ! use bacula-clientonly - then - # the database update scripts - mkdir -p ${D}/etc/bacula/updatedb - cp ${S}/updatedb/* ${D}/etc/bacula/updatedb/ - chmod 754 ${D}/etc/bacula/updatedb/* - - # the logrotate configuration - mkdir -p ${D}/etc/logrotate.d - cp ${S}/scripts/logrotate ${D}/etc/logrotate.d/bacula - chmod 644 ${D}/etc/logrotate.d/bacula - - # the logwatch scripts - mkdir -p ${D}/etc/log.d/conf/logfiles - mkdir -p ${D}/etc/log.d/conf/services - mkdir -p ${D}/etc/log.d/scripts/services - cp ${S}/scripts/logwatch/bacula ${D}/etc/log.d/scripts/services/bacula - cp ${S}/scripts/logwatch/logfile.bacula.conf ${D}/etc/log.d/conf/logfiles/bacula.conf - cp ${S}/scripts/logwatch/services.bacula.conf ${D}/etc/log.d/conf/services/bacula.conf - chmod 755 ${D}/etc/log.d/scripts/services/bacula - chmod 644 ${D}/etc/log.d/conf/logfiles/bacula.conf - chmod 644 ${D}/etc/log.d/conf/services/bacula.conf - - fi - - # the cdrom rescue package - mkdir -p ${D}/etc/bacula/rescue/cdrom - cp -R ${S}/rescue/linux/cdrom/* ${D}/etc/bacula/rescue/cdrom/ - mkdir ${D}/etc/bacula/rescue/cdrom/bin - cp ${S}/src/filed/static-bacula-fd ${D}/etc/bacula/rescue/cdrom/bin/bacula-fd - chmod 754 ${D}/etc/bacula/rescue/cdrom/bin/bacula-fd - - # documentation - for a in ${S}/{ChangeLog,README,ReleaseNotes,kernstodo,LICENSE,doc/latex/bacula.pdf} - do - dodoc $a - done - - dohtml -r ${S}/doc/latex/bacula - - # clean up permissions left broken by install - chmod o-r ${D}/etc/bacula/query.sql - - # remove the working dir so we can add it postinst with group - rmdir ${D}/var/bacula - - # init scripts - exeinto /etc/init.d - if use bacula-clientonly - then - newexe ${S}/platforms/gentoo/bacula-fd bacula-fd - else - if use bacula-split - then - newexe ${S}/platforms/gentoo/bacula-fd bacula-fd - newexe ${S}/platforms/gentoo/bacula-sd bacula-sd - newexe ${S}/platforms/gentoo/bacula-dir bacula-dir - else - newexe ${S}/platforms/gentoo/bacula-init bacula - fi - fi + make DESTDIR=${D} install || die + + if use static + then + cd ${S}/src/filed + cp static-bacula-fd ${D}/usr/sbin/bacula-fd + cd ${S}/src/console + cp static-console ${D}/usr/sbin/console + cd ${S}/src/dird + cp static-bacula-dir ${D}/usr/sbin/bacula-dir + if use gnome + then + cd ${S}/src/gnome-console + cp static-gnome-console ${D}/usr/sbin/gnome-console + fi + if use wxwindows + then + cd ${S}/src/wx-console + cp static-wx-console ${D}/usr/sbin/wx-console + fi + cd ${S}/src/stored + cp static-bacula-sd ${D}/usr/sbin/bacula-sd + fi + + # the menu stuff + if use gnome + then + mkdir -p ${D}/usr/share/pixmaps + mkdir -p ${D}/usr/share/applications + cp ${S}/scripts/bacula.png ${D}/usr/share/pixmaps/bacula.png + cp ${S}/scripts/bacula.desktop.gnome2.xsu ${D}/usr/share/applications/bacula.desktop + cp ${S}/src/tray-monitor/generic.xpm ${D}/usr/share/pixmaps/bacula-tray-monitor.xpm + cp ${S}/scripts/bacula-tray-monitor.desktop \ + ${D}/usr/share/applications/bacula-tray-monitor.desktop + chmod 755 ${D}/usr/sbin/bacula-tray-monitor + chmod 644 ${D}/etc/bacula/tray-monitor.conf + fi + + if ! use bacula-clientonly + then + # the database update scripts + mkdir -p ${D}/etc/bacula/updatedb + cp ${S}/updatedb/* ${D}/etc/bacula/updatedb/ + chmod 754 ${D}/etc/bacula/updatedb/* + + # the logrotate configuration + mkdir -p ${D}/etc/logrotate.d + cp ${S}/scripts/logrotate ${D}/etc/logrotate.d/bacula + chmod 644 ${D}/etc/logrotate.d/bacula + + # the logwatch scripts + mkdir -p ${D}/etc/log.d/conf/logfiles + mkdir -p ${D}/etc/log.d/conf/services + mkdir -p ${D}/etc/log.d/scripts/services + cp ${S}/scripts/logwatch/bacula ${D}/etc/log.d/scripts/services/bacula + cp ${S}/scripts/logwatch/logfile.bacula.conf ${D}/etc/log.d/conf/logfiles/bacula.conf + cp ${S}/scripts/logwatch/services.bacula.conf ${D}/etc/log.d/conf/services/bacula.conf + chmod 755 ${D}/etc/log.d/scripts/services/bacula + chmod 644 ${D}/etc/log.d/conf/logfiles/bacula.conf + chmod 644 ${D}/etc/log.d/conf/services/bacula.conf + + fi + + # the cdrom rescue package + mkdir -p ${D}/etc/bacula/rescue/cdrom + cp -R ${S}/rescue/linux/cdrom/* ${D}/etc/bacula/rescue/cdrom/ + mkdir ${D}/etc/bacula/rescue/cdrom/bin + cp ${S}/src/filed/static-bacula-fd ${D}/etc/bacula/rescue/cdrom/bin/bacula-fd + chmod 754 ${D}/etc/bacula/rescue/cdrom/bin/bacula-fd + + # documentation + for a in ${S}/{ChangeLog,README,ReleaseNotes,kernstodo,LICENSE,doc/latex/bacula.pdf} + do + dodoc $a + done + + dohtml -r ${S}/doc/latex/bacula + + # clean up permissions left broken by install + chmod o-r ${D}/etc/bacula/query.sql + + # remove the working dir so we can add it postinst with group + rmdir ${D}/var/bacula + + # init scripts + exeinto /etc/init.d + if use bacula-clientonly + then + newexe ${S}/platforms/gentoo/bacula-fd bacula-fd + else + if use bacula-split + then + newexe ${S}/platforms/gentoo/bacula-fd bacula-fd + newexe ${S}/platforms/gentoo/bacula-sd bacula-sd + newexe ${S}/platforms/gentoo/bacula-dir bacula-dir + else + newexe ${S}/platforms/gentoo/bacula-init bacula + fi + fi } pkg_postinst() { - # create the daemon group - HAVE_BACULA=`cat /etc/group | grep bacula 2>/dev/null` - if [ -z $HAVE_BACULA ]; then - enewgroup bacula - einfo - einfo "The group bacula has been created. Any users you add to" - einfo "this group have access to files created by the daemons." - fi - - # the working directory - install -m0750 -o root -g bacula -d ${ROOT}/var/bacula - - # link installed bacula-fd.conf into rescue directory - #ln -s /etc/bacula/bacula-fd.conf /etc/bacula/rescue/cdrom/bacula-fd.conf - # no longer necessary after 1.36.2 - - einfo - einfo "The CDRom rescue disk package has been installed into the" - einfo "/etc/bacula/rescue/cdrom/ directory. Please examine the manual" - einfo "for information on creating a rescue CD. CDR device detection" - einfo "during build has been disabled to prevent sandbox violations." - einfo "You need to examine /etc/bacula/rescue/cdrom/Makefile and adjust" - einfo "the device information for your CD recorder." - einfo - - if ! use bacula-clientonly; then - einfo - einfo "Please note either/or nature of database USE flags for" - einfo "Bacula. If mysql is set, it will be used, else postgres" - einfo "else finally SQLite. If you wish to have multiple DBs on" - einfo "one system, you may wish to unset auxillary DBs for this" - einfo "build." - einfo - - if use mysql - then - # test for an existing database - # note: this ASSUMES no password has been set for bacula database - DB_VER=`mysql 2>/dev/null bacula -e 'select * from Version;'|tail -n 1` - if [ -z "$DB_VER" ]; then - einfo "This appears to be a new install and you plan to use mysql" - einfo "for your catalog database. You should now create it by doing" - einfo "these commands:" - einfo " sh /etc/bacula/grant_mysql_privileges" - einfo " sh /etc/bacula/create_mysql_database" - einfo " sh /etc/bacula/make_mysql_tables" - elif [ "$DB_VER" -lt "8" ]; then - elinfo "This release requires an upgrade to your bacula database" - einfo "as the database format has changed. Please read the" - einfo "manual chapter for how to upgrade your database!!!" - einfo - einfo "Backup your database with the command:" - einfo " mysqldump -f --opt bacula | bzip2 > /var/bacula/bacula_backup.sql.bz" - einfo - einfo "Then update your database using the scripts found in" - einfo "/etc/bacula/updatedb/ from your current version $DB_VER to" - einfo "version 8. Note that scripts must be run in order from your" - einfo "version to the current version." - fi - fi - - if use postgres - then - # test for an existing database - # note: this ASSUMES no password has been set for bacula database - DB_VER=`echo 'select * from Version;' | psql bacula 2>/dev/null | tail -3 | head -1` - if [ -z "$DB_VER" ]; then - einfo "This appears to be a new install and you plan to use postgresql" - einfo "for your catalog database. You should now create it by doing" - einfo "these commands:" - einfo " sh /etc/bacula/create_postgresql_database" - einfo " sh /etc/bacula/make_postgresql_tables" - einfo " sh /etc/bacula/grant_postgresql_privileges" - elif [ "$DB_VER" -lt "8" ]; then - elinfo "This release requires an upgrade to your bacula database" - einfo "as the database format has changed. Please read the" - einfo "manual chapter for how to upgrade your database!!!" - einfo - einfo "Backup your database with the command:" - einfo " pg_dump bacula | bzip2 > /var/bacula/bacula_backup.sql.bz2" - einfo - einfo "Then update your database using the scripts found in" - einfo "/etc/bacula/updatedb/ from your current version $DB_VER to" - einfo "version 8. Note that scripts must be run in order from your" - einfo "version to the current version." - fi - fi - - if use sqlite - then - # test for an existing database - # note: this ASSUMES no password has been set for bacula database - DB_VER=`echo "select * from Version;" | sqlite 2>/dev/null /var/bacula/bacula.db | tail -n 1` - if [ -z "$DB_VER" ]; then - einfo "This appears to be a new install and you plan to use sqlite" - einfo "for your catalog database. You should now create it by doing" - einfo "these commands:" - einfo " sh /etc/bacula/grant_sqlite_privileges" - einfo " sh /etc/bacula/create_sqlite_database" - einfo " sh /etc/bacula/make_sqlite_tables" - elif [ "$DB_VER" -lt "8" ]; then - elinfo "This release requires an upgrade to your bacula database" - einfo "as the database format has changed. Please read the" - einfo "manual chapter for how to upgrade your database!!!" - einfo - einfo "Backup your database with the command:" - einfo " echo .dump | sqlite /var/bacula/bacula.db | bzip2 > \\" - einfo " /var/bacula/bacula_backup.sql.bz2" - einfo - einfo "Then update your database using the scripts found in" - einfo "/etc/bacula/updatedb/ from your current version $DB_VER to" - einfo "version 8. Note that scripts must be run in order from your" - einfo "version to the current version." - fi - fi - fi - - einfo - einfo "Review your configuration files in /etc/bacula and" - einfo "start the daemons:" - if use bacula-clientonly; then - einfo " /etc/init.d/bacula-fd start" - else - if use bacula-split; then - einfo " /etc/init.d/bacula-sd start" - einfo " /etc/init.d/bacula-dir start" - einfo " /etc/init.d/bacula-fd start" - einfo " or /etc/bacula/bacula will start all three." - else - einfo " /etc/init.d/bacula start" - fi - fi - einfo - einfo "You may also wish to:" - if use bacula-clientonly; then - einfo " rc-update add bacula-fd default" - else - if use bacula-split; then - einfo " rc-update add bacula-sd default" - einfo " rc-update add bacula-dir default" - einfo " rc-update add bacula-fd default" - else - einfo " rc-update add bacula default" - fi - fi - einfo + # create the daemon group + HAVE_BACULA=`cat /etc/group | grep bacula 2>/dev/null` + if [ -z $HAVE_BACULA ]; then + enewgroup bacula + einfo + einfo "The group bacula has been created. Any users you add to" + einfo "this group have access to files created by the daemons." + fi + + # the working directory + install -m0750 -o root -g bacula -d ${ROOT}/var/bacula + + # link installed bacula-fd.conf into rescue directory + #ln -s /etc/bacula/bacula-fd.conf /etc/bacula/rescue/cdrom/bacula-fd.conf + # no longer necessary after 1.36.2 + + einfo + einfo "The CDRom rescue disk package has been installed into the" + einfo "/etc/bacula/rescue/cdrom/ directory. Please examine the manual" + einfo "for information on creating a rescue CD. CDR device detection" + einfo "during build has been disabled to prevent sandbox violations." + einfo "You need to examine /etc/bacula/rescue/cdrom/Makefile and adjust" + einfo "the device information for your CD recorder." + einfo + + if ! use bacula-clientonly; then + einfo + einfo "Please note either/or nature of database USE flags for" + einfo "Bacula. If mysql is set, it will be used, else postgres" + einfo "else finally SQLite. If you wish to have multiple DBs on" + einfo "one system, you may wish to unset auxillary DBs for this" + einfo "build." + einfo + + if use mysql + then + # test for an existing database + # note: this ASSUMES no password has been set for bacula database + DB_VER=`mysql 2>/dev/null bacula -e 'select * from Version;'|tail -n 1` + if [ -z "$DB_VER" ]; then + einfo "This appears to be a new install and you plan to use mysql" + einfo "for your catalog database. You should now create it by doing" + einfo "these commands:" + einfo " sh /etc/bacula/grant_mysql_privileges" + einfo " sh /etc/bacula/create_mysql_database" + einfo " sh /etc/bacula/make_mysql_tables" + elif [ "$DB_VER" -lt "8" ]; then + elinfo "This release requires an upgrade to your bacula database" + einfo "as the database format has changed. Please read the" + einfo "manual chapter for how to upgrade your database!!!" + einfo + einfo "Backup your database with the command:" + einfo " mysqldump -f --opt bacula | bzip2 > /var/bacula/bacula_backup.sql.bz" + einfo + einfo "Then update your database using the scripts found in" + einfo "/etc/bacula/updatedb/ from your current version $DB_VER to" + einfo "version 8. Note that scripts must be run in order from your" + einfo "version to the current version." + fi + fi + + if use postgres + then + # test for an existing database + # note: this ASSUMES no password has been set for bacula database + DB_VER=`echo 'select * from Version;' | psql bacula 2>/dev/null | tail -3 | head -1` + if [ -z "$DB_VER" ]; then + einfo "This appears to be a new install and you plan to use postgresql" + einfo "for your catalog database. You should now create it by doing" + einfo "these commands:" + einfo " sh /etc/bacula/create_postgresql_database" + einfo " sh /etc/bacula/make_postgresql_tables" + einfo " sh /etc/bacula/grant_postgresql_privileges" + elif [ "$DB_VER" -lt "8" ]; then + elinfo "This release requires an upgrade to your bacula database" + einfo "as the database format has changed. Please read the" + einfo "manual chapter for how to upgrade your database!!!" + einfo + einfo "Backup your database with the command:" + einfo " pg_dump bacula | bzip2 > /var/bacula/bacula_backup.sql.bz2" + einfo + einfo "Then update your database using the scripts found in" + einfo "/etc/bacula/updatedb/ from your current version $DB_VER to" + einfo "version 8. Note that scripts must be run in order from your" + einfo "version to the current version." + fi + fi + + if use sqlite + then + # test for an existing database + # note: this ASSUMES no password has been set for bacula database + DB_VER=`echo "select * from Version;" | sqlite 2>/dev/null /var/bacula/bacula.db | tail -n 1` + if [ -z "$DB_VER" ]; then + einfo "This appears to be a new install and you plan to use sqlite" + einfo "for your catalog database. You should now create it by doing" + einfo "these commands:" + einfo " sh /etc/bacula/grant_sqlite_privileges" + einfo " sh /etc/bacula/create_sqlite_database" + einfo " sh /etc/bacula/make_sqlite_tables" + elif [ "$DB_VER" -lt "8" ]; then + elinfo "This release requires an upgrade to your bacula database" + einfo "as the database format has changed. Please read the" + einfo "manual chapter for how to upgrade your database!!!" + einfo + einfo "Backup your database with the command:" + einfo " echo .dump | sqlite /var/bacula/bacula.db | bzip2 > \\" + einfo " /var/bacula/bacula_backup.sql.bz2" + einfo + einfo "Then update your database using the scripts found in" + einfo "/etc/bacula/updatedb/ from your current version $DB_VER to" + einfo "version 8. Note that scripts must be run in order from your" + einfo "version to the current version." + fi + fi + fi + + einfo + einfo "Review your configuration files in /etc/bacula and" + einfo "start the daemons:" + if use bacula-clientonly; then + einfo " /etc/init.d/bacula-fd start" + else + if use bacula-split; then + einfo " /etc/init.d/bacula-sd start" + einfo " /etc/init.d/bacula-dir start" + einfo " /etc/init.d/bacula-fd start" + einfo " or /etc/bacula/bacula will start all three." + else + einfo " /etc/init.d/bacula start" + fi + fi + einfo + einfo "You may also wish to:" + if use bacula-clientonly; then + einfo " rc-update add bacula-fd default" + else + if use bacula-split; then + einfo " rc-update add bacula-sd default" + einfo " rc-update add bacula-dir default" + einfo " rc-update add bacula-fd default" + else + einfo " rc-update add bacula default" + fi + fi + einfo } diff --git a/bacula/platforms/hurd/Makefile.in b/bacula/platforms/hurd/Makefile.in index c8f392eea1..e67cd4ce30 100644 --- a/bacula/platforms/hurd/Makefile.in +++ b/bacula/platforms/hurd/Makefile.in @@ -1,4 +1,7 @@ # +# Copyright (C) Kern Sibbald 2008-2015 +# License: BSD 2-Clause +# # This file is used as the template to create the # Makefile for the Debian GNU Hurd specific installation. # diff --git a/bacula/platforms/hurd/bacula-dir.in b/bacula/platforms/hurd/bacula-dir.in index 88c13a31a1..8ea69645df 100644 --- a/bacula/platforms/hurd/bacula-dir.in +++ b/bacula/platforms/hurd/bacula-dir.in @@ -1,5 +1,8 @@ #! /bin/sh # +# Copyright (C) Kern Sibbald 2008-2015 +# License: BSD 2-Clause +# # bacula This shell script takes care of starting and stopping # the bacula Director daemon on Debian GNU Hurd systems. # @@ -47,6 +50,7 @@ if [ "x${BUSER}" != "x" ]; then fi fi +RETVAL=0 case "$1" in start) echo -n "Starting ${DESC}: " @@ -64,6 +68,7 @@ case "$1" in $0 stop sleep 5 $0 start + RETVAL=$? ;; *) echo "Usage: /etc/init.d/${NAME} {start|stop|restart|force-reload}" >&2 diff --git a/bacula/platforms/hurd/bacula-fd.in b/bacula/platforms/hurd/bacula-fd.in index 270950a7dd..b8cca0cce6 100644 --- a/bacula/platforms/hurd/bacula-fd.in +++ b/bacula/platforms/hurd/bacula-fd.in @@ -1,5 +1,8 @@ #! /bin/sh # +# Copyright (C) Kern Sibbald 2008-2015 +# License: BSD 2-Clause +# # bacula This shell script takes care of starting and stopping # the bacula Director daemon on Debian GNU Hurd systems. # @@ -47,6 +50,7 @@ if [ "x${BUSER}" != "x" ]; then fi fi +RETVAL=0 case "$1" in start) echo -n "Starting ${DESC}: " @@ -64,6 +68,7 @@ case "$1" in $0 stop sleep 5 $0 start + RETVAL=$? ;; *) echo "Usage: /etc/init.d/${NAME} {start|stop|restart|force-reload}" >&2 diff --git a/bacula/platforms/hurd/bacula-sd.in b/bacula/platforms/hurd/bacula-sd.in index ff1ad29a8d..9aaf2cef61 100644 --- a/bacula/platforms/hurd/bacula-sd.in +++ b/bacula/platforms/hurd/bacula-sd.in @@ -1,5 +1,8 @@ #! /bin/sh # +# Copyright (C) Kern Sibbald 2008-2015 +# License: BSD 2-Clause +# # bacula This shell script takes care of starting and stopping # the bacula Director daemon on Debian GNU Hurd systems. # @@ -47,6 +50,7 @@ if [ "x${BUSER}" != "x" ]; then fi fi +RETVAL=0 case "$1" in start) echo -n "Starting ${DESC}: " @@ -64,6 +68,7 @@ case "$1" in $0 stop sleep 5 $0 start + RETVAL=$? ;; *) echo "Usage: /etc/init.d/${NAME} {start|stop|restart|force-reload}" >&2 diff --git a/bacula/platforms/irix/Makefile.in b/bacula/platforms/irix/Makefile.in index 88b188b8a6..6e670b11d6 100644 --- a/bacula/platforms/irix/Makefile.in +++ b/bacula/platforms/irix/Makefile.in @@ -1,3 +1,6 @@ +# +# Copyright (C) Kern Sibbald 2001-2015 +# License: BSD 2-Clause # # This file is used as the template to create the # Makefile for the Solaris specific installation. diff --git a/bacula/platforms/irix/bacula-dir.in b/bacula/platforms/irix/bacula-dir.in index af7b0c5c1a..6f283f0874 100755 --- a/bacula/platforms/irix/bacula-dir.in +++ b/bacula/platforms/irix/bacula-dir.in @@ -1,5 +1,8 @@ #! /bin/sh # +# Copyright (C) Kern Sibbald 2000-2015 +# License: BSD 2-Clause +# # bacula This shell script takes care of starting and stopping # the bacula Director daemon # @@ -29,10 +32,11 @@ case "$1" in $0 stop sleep 5 $0 start + RETVAL=$? ;; *) echo "Usage: $0 {start|stop|restart}" exit 1 ;; esac -exit 0 +exit $RETVAL diff --git a/bacula/platforms/irix/bacula-fd.in b/bacula/platforms/irix/bacula-fd.in index 671eb4b0c2..374faf956a 100755 --- a/bacula/platforms/irix/bacula-fd.in +++ b/bacula/platforms/irix/bacula-fd.in @@ -1,5 +1,8 @@ #! /bin/sh # +# Copyright (C) Kern Sibbald 2000-2015 +# License: BSD 2-Clause +# # bacula This shell script takes care of starting and stopping # the bacula File daemon. # @@ -9,6 +12,7 @@ # For Bacula release @VERSION@ (@DATE@) -- @DISTNAME@ # +RETVAL=0 case "$1" in 'start') echo "Starting the Bacula File daemon: " @@ -30,10 +34,11 @@ case "$1" in $0 stop sleep 5 $0 start + RETVAL=$? ;; *) echo "Usage: $0 {start|stop|restart}" exit 1 ;; esac -exit 0 +exit $RETVAL diff --git a/bacula/platforms/irix/bacula-sd.in b/bacula/platforms/irix/bacula-sd.in index 9f4e6f0c70..1db2740aa1 100755 --- a/bacula/platforms/irix/bacula-sd.in +++ b/bacula/platforms/irix/bacula-sd.in @@ -1,5 +1,8 @@ #! /bin/sh # +# Copyright (C) Kern Sibbald 2000-2015 +# License: BSD 2-Clause +# # bacula This shell script takes care of starting and stopping # the bacula Storage daemon. # @@ -9,6 +12,7 @@ # For Bacula release @VERSION@ (@DATE@) -- @DISTNAME@ # +RETVAL=0 case "$1" in start) echo "Starting the Bacula Storage daemon: " @@ -28,10 +32,11 @@ case "$1" in $0 stop sleep 5 $0 start + RETVAL=$? ;; *) echo "Usage: $0 {start|stop|restart}" exit 1 ;; esac -exit 0 +exit $RETVAL diff --git a/bacula/platforms/mandrake/Makefile.in b/bacula/platforms/mandrake/Makefile.in index 1d43bbb9e6..5f58f5cb56 100644 --- a/bacula/platforms/mandrake/Makefile.in +++ b/bacula/platforms/mandrake/Makefile.in @@ -1,3 +1,6 @@ +# +# Copyright (C) Kern Sibbald 2001-2015 +# License: BSD 2-Clause # # This file is used as the template to create the # Makefile for the Mandrake specific installation. diff --git a/bacula/platforms/mandrake/bacula-dir.in b/bacula/platforms/mandrake/bacula-dir.in index 431244672c..df82553815 100755 --- a/bacula/platforms/mandrake/bacula-dir.in +++ b/bacula/platforms/mandrake/bacula-dir.in @@ -1,5 +1,8 @@ #! /bin/sh # +# Copyright (C) Kern Sibbald 2000-2015 +# License: BSD 2-Clause +# # bacula This shell script takes care of starting and stopping # the bacula Director daemon # @@ -32,6 +35,7 @@ case "$1" in $0 stop sleep 5 $0 start + RETVAL=$? ;; status) status @sbindir@/bacula-dir @@ -41,4 +45,4 @@ case "$1" in exit 1 ;; esac -exit 0 +exit $RETVAL diff --git a/bacula/platforms/mandrake/bacula-fd.in b/bacula/platforms/mandrake/bacula-fd.in index c447fb159f..82b3a66fc4 100755 --- a/bacula/platforms/mandrake/bacula-fd.in +++ b/bacula/platforms/mandrake/bacula-fd.in @@ -1,5 +1,8 @@ #! /bin/sh # +# Copyright (C) Kern Sibbald 2000-2015 +# License: BSD 2-Clause +# # bacula This shell script takes care of starting and stopping # the bacula File daemon. # @@ -12,6 +15,7 @@ # Source function library . /etc/rc.d/init.d/functions +RETVAL=0 case "$1" in start) echo -n "Starting the Bacula File daemon: " @@ -31,6 +35,7 @@ case "$1" in $0 stop sleep 5 $0 start + RETVAL=$? ;; status) status @sbindir@/bacula-fd @@ -40,4 +45,4 @@ case "$1" in exit 1 ;; esac -exit 0 +exit $RETVAL diff --git a/bacula/platforms/mandrake/bacula-sd.in b/bacula/platforms/mandrake/bacula-sd.in index f0144dd955..211167934d 100755 --- a/bacula/platforms/mandrake/bacula-sd.in +++ b/bacula/platforms/mandrake/bacula-sd.in @@ -1,5 +1,8 @@ #! /bin/sh # +# Copyright (C) Kern Sibbald 2000-2015 +# License: BSD 2-Clause +# # bacula This shell script takes care of starting and stopping # the bacula Storage daemon. # @@ -12,6 +15,7 @@ # Source function library . /etc/rc.d/init.d/functions +RETVAL=0 case "$1" in start) echo -n "Starting the Bacula Storage daemon: " @@ -31,6 +35,7 @@ case "$1" in $0 stop sleep 5 $0 start + RETVAL=$? ;; status) status @sbindir@/bacula-sd @@ -40,4 +45,4 @@ case "$1" in exit 1 ;; esac -exit 0 +exit $RETVAL diff --git a/bacula/platforms/mandrake/bacula.spec.bluca.in b/bacula/platforms/mandrake/bacula.spec.bluca.in index 8f596c29ed..1c72f45e46 100644 --- a/bacula/platforms/mandrake/bacula.spec.bluca.in +++ b/bacula/platforms/mandrake/bacula.spec.bluca.in @@ -20,7 +20,7 @@ Name: %{name} Version: %{version} Release: %{release} Group: Archiving/Backup -License: GPL +License: BSD 2-Clause Source: http://www.prdownloads.sourceforge.net/bacula/%{name}-%{version}.tar.bz2 Source1: %{name}-icons.tar.bz2 BuildRoot: %{_tmppath}/%{name}-root diff --git a/bacula/platforms/openbsd/Makefile.in b/bacula/platforms/openbsd/Makefile.in index 5a84037692..314abc31fa 100644 --- a/bacula/platforms/openbsd/Makefile.in +++ b/bacula/platforms/openbsd/Makefile.in @@ -1,3 +1,6 @@ +# +# Copyright (C) Kern Sibbald 2001-2015 +# License: BSD 2-Clause # # This file is used as the template to create the # Makefile for the Solaris specific installation. diff --git a/bacula/platforms/openbsd/bacula-dir.in b/bacula/platforms/openbsd/bacula-dir.in index af7b0c5c1a..6f283f0874 100755 --- a/bacula/platforms/openbsd/bacula-dir.in +++ b/bacula/platforms/openbsd/bacula-dir.in @@ -1,5 +1,8 @@ #! /bin/sh # +# Copyright (C) Kern Sibbald 2000-2015 +# License: BSD 2-Clause +# # bacula This shell script takes care of starting and stopping # the bacula Director daemon # @@ -29,10 +32,11 @@ case "$1" in $0 stop sleep 5 $0 start + RETVAL=$? ;; *) echo "Usage: $0 {start|stop|restart}" exit 1 ;; esac -exit 0 +exit $RETVAL diff --git a/bacula/platforms/openbsd/bacula-fd.in b/bacula/platforms/openbsd/bacula-fd.in index 2c41b34325..f02b16db7b 100755 --- a/bacula/platforms/openbsd/bacula-fd.in +++ b/bacula/platforms/openbsd/bacula-fd.in @@ -1,5 +1,8 @@ #! /bin/sh # +# Copyright (C) Kern Sibbald 2000-2015 +# License: BSD 2-Clause +# # bacula This shell script takes care of starting and stopping # the bacula File daemon. # @@ -9,6 +12,7 @@ # For Bacula release @VERSION@ (@DATE@) -- @DISTNAME@ # +RETVAL=0 case "$1" in start) echo "Starting the Bacula File daemon: " @@ -28,10 +32,11 @@ case "$1" in $0 stop sleep 5 $0 start + RETVAL=$? ;; *) echo "Usage: $0 {start|stop|restart}" exit 1 ;; esac -exit 0 +exit $RETVAL diff --git a/bacula/platforms/openbsd/bacula-sd.in b/bacula/platforms/openbsd/bacula-sd.in index 9f4e6f0c70..1db2740aa1 100755 --- a/bacula/platforms/openbsd/bacula-sd.in +++ b/bacula/platforms/openbsd/bacula-sd.in @@ -1,5 +1,8 @@ #! /bin/sh # +# Copyright (C) Kern Sibbald 2000-2015 +# License: BSD 2-Clause +# # bacula This shell script takes care of starting and stopping # the bacula Storage daemon. # @@ -9,6 +12,7 @@ # For Bacula release @VERSION@ (@DATE@) -- @DISTNAME@ # +RETVAL=0 case "$1" in start) echo "Starting the Bacula Storage daemon: " @@ -28,10 +32,11 @@ case "$1" in $0 stop sleep 5 $0 start + RETVAL=$? ;; *) echo "Usage: $0 {start|stop|restart}" exit 1 ;; esac -exit 0 +exit $RETVAL diff --git a/bacula/platforms/osx/Makefile.in b/bacula/platforms/osx/Makefile.in index b0de11f813..d98fc92420 100644 --- a/bacula/platforms/osx/Makefile.in +++ b/bacula/platforms/osx/Makefile.in @@ -1,10 +1,13 @@ # +# Copyright (C) Kern Sibbald 2009-2015 +# License: BSD 2-Clause +# # This is the makefile template for the platform directory # which contains general platform installation. # # 17 August 2009 -- Lorenz Schori # -# for Bacula release @VERSION@ (@DATE@) -- @DISTNAME@ +# for Bacula Enterprise release @VERSION@ (@DATE@) -- @DISTNAME@ # @@ -39,8 +42,8 @@ BACULA_FD_CONF:=/Library/Preferences/bacula/bacula-fd.conf BACULA_WORKING_DIR:=/private/var/bacula/working BACULA_PMDOC:=${WORKING_DIR}/installer.pmdoc -# Detect whether we sit inside the bacula source tree. In this case we won't -# download the tar from sourceforge but instead work with what its there +# Detect whether we sit inside the Bacula source tree. In this case we won't +# download the tar from sourceforge but instead work with what is there # already CURSUB:=$(CURDIR:%/platforms/osx=%) ifneq ($(CURDIR),$(CURSUB)) @@ -49,8 +52,8 @@ ifneq ($(CURDIR),$(CURSUB)) # BACULA_VERSION:=$(shell sed -n 's,^VERSION=,,p' $(CURSUB)/autoconf/Make.common) endif -PACKAGE_TITLE:=Bacula File Daemon ${BACULA_VERSION} -PACKAGE_ID:=org.bacula.bacula-fd.pkg +PACKAGE_TITLE:=Bacula Enterprise File Daemon ${BACULA_VERSION} +PACKAGE_ID:=com.baculasystems.bacula-fd.pkg PACKAGE_DIR:=${PRODUCTS_DIR}/${PACKAGE_TITLE} PACKAGE_BUNDLE:=${PACKAGE_DIR}/${PACKAGE_TITLE}.pkg PACKAGE_DMG:=${PRODUCTS_DIR}/${PACKAGE_TITLE}.dmg @@ -58,12 +61,18 @@ PACKAGE_RESOURCES:=ReadMe.html postflight preupgrade PACKAGE_XRESOURCES:=postflight preupgrade # Flags for the toolchain -CONFIGFLAGS:=--enable-client-only --prefix=${BACULA_PREFIX} \ - --with-dir-password=@DIR_PW@ --with-fd-password=@FD_PW@ \ - --with-sd-password=@SD_PW@ --with-mon-dir-password=@MON_DIR_PW@ \ - --with-mon-fd-password=@MON_FD_PW@ --with-mon-sd-password=@MON_SD_PW@ \ - --with-basename=@BASENAME@ --with-hostname=@HOSTNAME@ \ - --with-working-dir=${BACULA_WORKING_DIR} +CONFIGFLAGS:= \ + --enable-client-only \ + --prefix=${BACULA_PREFIX} \ + --with-dir-password=@DIR_PW@ \ + --with-fd-password=@FD_PW@ \ + --with-sd-password=@SD_PW@ \ + --with-mon-dir-password=@MON_DIR_PW@ \ + --with-mon-fd-password=@MON_FD_PW@ \ + --with-mon-sd-password=@MON_SD_PW@ \ + --with-basename=@BASENAME@ \ + --with-hostname=@HOSTNAME@ \ + --with-working-dir=${BACULA_WORKING_DIR} CPPFLAGS:=-isysroot ${MACOSX_SDK_SYSROOT} ${MACOSX_VERSION_FLAGS} CFLAGS:=-O -g ${ARCHFLAGS} CXXFLAGS:=${CFLAGS} @@ -134,8 +143,8 @@ ${BACULA_DESTDIR}: ${BACULA_SOURCE} done mkdir -p "${BACULA_DESTDIR}${BACULA_PREFIX}/Library/LaunchDaemons" - sed ${INFILE_SUBST} files/org.bacula.bacula-fd.plist.in \ - > "${BACULA_DESTDIR}${BACULA_PREFIX}/Library/LaunchDaemons/org.bacula.bacula-fd.plist" + sed ${INFILE_SUBST} files/com.baculasystems.bacula-fd.plist.in \ + > "${BACULA_DESTDIR}${BACULA_PREFIX}/Library/LaunchDaemons/com.baculasystems.bacula-fd.plist" ${BACULA_SOURCE}: ${BACULA_TAR} mkdir -p "${WORKING_DIR}" @@ -152,4 +161,3 @@ distclean: clean .PHONY: clean clean: rm -rf "${BUILD_DIR}" "${PACKAGE_DIR}" "${PACKAGE_DMG}" - diff --git a/bacula/platforms/osx/README b/bacula/platforms/osx/README index 44813d11e2..4b1391d6e1 100644 --- a/bacula/platforms/osx/README +++ b/bacula/platforms/osx/README @@ -2,10 +2,10 @@ Bacula file daemon package builder for Mac OS X =============================================== This package build script lets you download, compile and package the bacula -file daemon easily with a single command line. Beside the bacula file daemon +file daemon easily with a single command line. In addition to the Bacula file daemon the resulting installer package contains a short ReadMe file with instructions on how to install and use the software. Also a basic launchd property list is -included along with preugrade and postflight installer scripts to stop and +included along with preupgrade and postflight installer scripts to stop and restart the daemon while upgrading. To ensure the security of the users the passwords in the configuration files are generated during a first time installation and file permissions are checked and corrected on upgrades. @@ -14,7 +14,7 @@ Requirements: * Mac OS X 10.5 or later (building/packaging), 10.4 or later (deployment) * Mac OS X developer tools installed -Example (compile and create package from within bacula source tree): +Example (compile and create package from within Bacula source tree): $ ./configure --enable-client-only $ make -C platforms/osx diff --git a/bacula/platforms/redhat/Makefile.in b/bacula/platforms/redhat/Makefile.in index 0c2d5e6e85..809ab2533c 100644 --- a/bacula/platforms/redhat/Makefile.in +++ b/bacula/platforms/redhat/Makefile.in @@ -1,3 +1,6 @@ +# +# Copyright (C) Kern Sibbald 2001-2015 +# License: BSD 2-Clause # # This file is used as the template to create the # Makefile for the RedHat specific installation. diff --git a/bacula/platforms/redhat/bacula-dir.in b/bacula/platforms/redhat/bacula-dir.in index 06038560ea..76ee60b7cf 100755 --- a/bacula/platforms/redhat/bacula-dir.in +++ b/bacula/platforms/redhat/bacula-dir.in @@ -1,5 +1,8 @@ #! /bin/sh # +# Copyright (C) Kern Sibbald 2000-2015 +# License: BSD 2-Clause +# # bacula This shell script takes care of starting and stopping # the bacula Director daemon # @@ -12,6 +15,8 @@ # Source function library . /etc/rc.d/init.d/functions +DAEMON_OPTIONS='' +DAEMON_USER='yes' DIR_USER=@dir_user@ DIR_GROUP=@dir_group@ DIR_OPTIONS='' @@ -22,7 +27,7 @@ if [ -d "/lib/tls" -a $OS = "Linux" -a `uname -r | cut -c1-3` = "2.4" ] ; then export LD_ASSUME_KERNEL=2.4.19 fi -# pull in any user defined DIR_DIR_OPTIONS, DIR_USER, or DIR_GROUP +# pull in any user defined DIR_DIR_OPTIONS, DIR_USER, DIR_GROUP or DAEMON_USER [ -f /etc/sysconfig/bacula ] && . /etc/sysconfig/bacula # @@ -41,8 +46,18 @@ case "$1" in if [ "${DIR_GROUP}" != '' ]; then DIR_OPTIONS="${DIR_OPTIONS} -g ${DIR_GROUP}" fi + + if [ "${DAEMON_USER}" != '' -a "${DIR_USER}" != '' ]; then + DIR_OPTIONS="" + if [ "${DIR_GROUP}" != '' ]; then + chown ${DIR_USER}:${DIR_GROUP} @working_dir@/bacula-dir* 2> /dev/null + else + chown ${DIR_USER} @working_dir@/bacula-dir* 2> /dev/null + fi + DAEMON_OPTIONS="--user ${DIR_USER}" + fi echo -n "Starting Bacula Director services: " - daemon @sbindir@/bacula-dir $2 ${DIR_OPTIONS} -c @sysconfdir@/bacula-dir.conf + daemon $DAEMON_OPTIONS @sbindir@/bacula-dir $2 ${DIR_OPTIONS} -c @sysconfdir@/bacula-dir.conf RETVAL=$? echo [ $RETVAL -eq 0 ] && touch @subsysdir@/bacula-dir @@ -58,6 +73,7 @@ case "$1" in $0 stop sleep 5 $0 start + RETVAL=$? ;; status) status @sbindir@/bacula-dir diff --git a/bacula/platforms/redhat/bacula-fd.in b/bacula/platforms/redhat/bacula-fd.in index ba9445397c..2534b9e489 100755 --- a/bacula/platforms/redhat/bacula-fd.in +++ b/bacula/platforms/redhat/bacula-fd.in @@ -1,5 +1,8 @@ #! /bin/sh # +# Copyright (C) Kern Sibbald 2000-2015 +# License: BSD 2-Clause +# # bacula This shell script takes care of starting and stopping # the bacula File daemon. # @@ -12,6 +15,8 @@ # Source function library . /etc/rc.d/init.d/functions +DAEMON_OPTIONS='' +DAEMON_USER='yes' FD_USER=@fd_user@ FD_GROUP=@fd_group@ FD_OPTIONS='' @@ -41,8 +46,19 @@ case "$1" in if [ "${FD_GROUP}" != '' ]; then FD_OPTIONS="${FD_OPTIONS} -g ${FD_GROUP}" fi + + if [ "${DAEMON_USER}" != '' -a "${FD_USER}" != '' ]; then + FD_OPTIONS="" + if [ "${FD_GROUP}" != '' ]; then + chown ${FD_USER}:${FD_GROUP} @working_dir@/bacula-fd* 2> /dev/null + else + chown ${FD_USER} @working_dir@/bacula-fd* 2> /dev/null + fi + DAEMON_OPTIONS="--user ${FD_USER}" + fi + echo -n "Starting Bacula File services: " - daemon @sbindir@/bacula-fd $2 ${FD_OPTIONS} -c @sysconfdir@/bacula-fd.conf + daemon ${DAEMON_OPTIONS} @sbindir@/bacula-fd $2 ${FD_OPTIONS} -c @sysconfdir@/bacula-fd.conf RETVAL=$? echo [ $RETVAL -eq 0 ] && touch @subsysdir@/bacula-fd @@ -58,6 +74,7 @@ case "$1" in $0 stop sleep 5 $0 start + RETVAL=$? ;; status) status @sbindir@/bacula-fd diff --git a/bacula/platforms/redhat/bacula-sd.in b/bacula/platforms/redhat/bacula-sd.in index ab5d8732c7..d43d552c5f 100755 --- a/bacula/platforms/redhat/bacula-sd.in +++ b/bacula/platforms/redhat/bacula-sd.in @@ -1,5 +1,8 @@ #! /bin/sh # +# Copyright (C) Kern Sibbald 2000-2015 +# License: BSD 2-Clause +# # bacula This shell script takes care of starting and stopping # the bacula Storage daemon. # @@ -12,6 +15,8 @@ # Source function library . /etc/rc.d/init.d/functions +DAEMON_OPTIONS='' +DAEMON_USER=yes SD_USER=@sd_user@ SD_GROUP=@sd_group@ SD_OPTIONS='' @@ -22,7 +27,7 @@ if [ -d "/lib/tls" -a $OS = "Linux" -a `uname -r | cut -c1-3` = "2.4" ] ; then export LD_ASSUME_KERNEL=2.4.19 fi -# pull in any user defined SD_OPTIONS, SD_USER, or SD_GROUP +# pull in any user defined SD_OPTIONS, SD_USER, SD_GROUP or DAEMON_USER [ -f /etc/sysconfig/bacula ] && . /etc/sysconfig/bacula # @@ -41,9 +46,19 @@ case "$1" in if [ "${SD_GROUP}" != '' ]; then SD_OPTIONS="${SD_OPTIONS} -g ${SD_GROUP}" fi - + + if [ "${DAEMON_USER}" != '' -a "${SD_USER}" != '' ]; then + SD_OPTIONS="" + if [ "${SD_GROUP}" != '' ]; then + chown ${SD_USER}:${SD_GROUP} @working_dir@/bacula-sd* 2> /dev/null + else + chown ${SD_USER} @working_dir@/bacula-sd* 2> /dev/null + fi + DAEMON_OPTIONS="--user ${SD_USER}" + fi + echo -n "Starting Bacula Storage services: " - daemon @sbindir@/bacula-sd $2 ${SD_OPTIONS} -c @sysconfdir@/bacula-sd.conf + daemon $DAEMON_OPTIONS @sbindir@/bacula-sd $2 ${SD_OPTIONS} -c @sysconfdir@/bacula-sd.conf RETVAL=$? echo [ $RETVAL -eq 0 ] && touch @subsysdir@/bacula-sd @@ -59,6 +74,7 @@ case "$1" in $0 stop sleep 5 $0 start + RETVAL=$? ;; status) status @sbindir@/bacula-sd diff --git a/bacula/platforms/slackware/Makefile.in b/bacula/platforms/slackware/Makefile.in index ecdee1b2dc..3bf5846151 100644 --- a/bacula/platforms/slackware/Makefile.in +++ b/bacula/platforms/slackware/Makefile.in @@ -1,3 +1,6 @@ +# +# Copyright (C) Kern Sibbald 2003-2015 +# License: BSD 2-Clause # # This file is used as the template to create the # Makefile for the Slackware specific installation. diff --git a/bacula/platforms/slackware/functions.bacula.in b/bacula/platforms/slackware/functions.bacula.in index f9ef20bb5f..0e36cbc739 100644 --- a/bacula/platforms/slackware/functions.bacula.in +++ b/bacula/platforms/slackware/functions.bacula.in @@ -1,7 +1,10 @@ #! /bin/sh # +# Copyright (C) Kern Sibbald 2000-2015 +# License: BSD 2-Clause +# # bacula This shell script takes care of starting and stopping -# the bacula daemons. +# the bacula daemons. # # This is pretty much watered down version of the RedHat script # that works on Solaris as well as Linux, but it won't work everywhere. @@ -40,17 +43,17 @@ killproc() { RC=0 # Test syntax. if [ $# = 0 ]; then - echo "Usage: killproc {program} [signal]" - return 1 + echo "Usage: killproc {program} [signal]" + return 1 fi notset=0 # check for third arg to be kill level if [ "$3" != "" ] ; then - killlevel=$3 + killlevel=$3 else - notset=1 - killlevel="-9" + notset=1 + killlevel="-9" fi # Get base program name @@ -61,39 +64,39 @@ killproc() { # Kill it. if [ "$pid" != "" ] ; then - if [ "$notset" = "1" ] ; then - if ps -p $pid>/dev/null 2>&1; then - # TERM first, then KILL if not dead - kill -TERM $pid 2>/dev/null - sleep 1 - if ps -p $pid >/dev/null 2>&1 ; then - sleep 1 - if ps -p $pid >/dev/null 2>&1 ; then - sleep 3 - if ps -p $pid >/dev/null 2>&1 ; then - kill -KILL $pid 2>/dev/null - fi - fi - fi - fi - ps -p $pid >/dev/null 2>&1 - RC=$? - [ $RC -eq 0 ] && failure "$base shutdown" || success "$base shutdown" - # RC=$((! $RC)) - # use specified level only - else - if ps -p $pid >/dev/null 2>&1; then - kill $killlevel $pid 2>/dev/null - RC=$? - [ $RC -eq 0 ] && success "$base $killlevel" || failure "$base $killlevel" - fi - fi + if [ "$notset" = "1" ] ; then + if ps -p $pid>/dev/null 2>&1; then + # TERM first, then KILL if not dead + kill -TERM $pid 2>/dev/null + sleep 1 + if ps -p $pid >/dev/null 2>&1 ; then + sleep 1 + if ps -p $pid >/dev/null 2>&1 ; then + sleep 3 + if ps -p $pid >/dev/null 2>&1 ; then + kill -KILL $pid 2>/dev/null + fi + fi + fi + fi + ps -p $pid >/dev/null 2>&1 + RC=$? + [ $RC -eq 0 ] && failure "$base shutdown" || success "$base shutdown" + # RC=$((! $RC)) + # use specified level only + else + if ps -p $pid >/dev/null 2>&1; then + kill $killlevel $pid 2>/dev/null + RC=$? + [ $RC -eq 0 ] && success "$base $killlevel" || failure "$base $killlevel" + fi + fi else - failure "$base shutdown" + failure "$base shutdown" fi # Remove pid file if any. if [ "$notset" = "1" ]; then - rm -f ${PIDDIR}/$base.$2.pid + rm -f ${PIDDIR}/$base.$2.pid fi return $RC } @@ -103,8 +106,8 @@ pidofproc() { pid="" # Test syntax. if [ $# = 0 ] ; then - echo "Usage: pidofproc {program}" - return 1 + echo "Usage: pidofproc {program}" + return 1 fi # Get base program name @@ -112,11 +115,11 @@ pidofproc() { # First try PID file if [ -f ${PIDDIR}/$base.$2.pid ] ; then - pid=`head -1 ${PIDDIR}/$base.$2.pid` - if [ "$pid" != "" ] ; then - echo $pid - return 0 - fi + pid=`head -1 ${PIDDIR}/$base.$2.pid` + if [ "$pid" != "" ] ; then + echo $pid + return 0 + fi fi # Next try "pidof" @@ -136,8 +139,8 @@ pidofproc() { status() { # Test syntax. if [ $# = 0 ] ; then - echo "Usage: status {program}" - return 1 + echo "Usage: status {program}" + return 1 fi # Get base program name @@ -152,27 +155,27 @@ status() { return 0 else pid=`${PSCMD} | awk 'BEGIN { prog=ARGV[1]; ARGC=1 } - { if ((prog == $2) || (("(" prog ")") == $2) || - (("[" prog "]") == $2) || - ((prog ":") == $2)) { print $1 ; exit 0 } }' $1` + { if ((prog == $2) || (("(" prog ")") == $2) || + (("[" prog "]") == $2) || + ((prog ":") == $2)) { print $1 ; exit 0 } }' $1` if [ "$pid" != "" ] ; then - echo "$base (pid $pid) is running..." - return 0 + echo "$base (pid $pid) is running..." + return 0 fi fi # Next try the PID files if [ -f ${PIDDIR}/$base.$2.pid ] ; then - pid=`head -1 ${PIDDIR}/$base.$2.pid` - if [ "$pid" != "" ] ; then - echo "$base not running, but pid file exists" - return 1 - fi + pid=`head -1 ${PIDDIR}/$base.$2.pid` + if [ "$pid" != "" ] ; then + echo "$base not running, but pid file exists" + return 1 + fi fi # See if the subsys lock exists if [ -f ${SUBSYSDIR}/$base ] ; then - echo "$base not running, but subsys locked" - return 2 + echo "$base not running, but subsys locked" + return 2 fi echo "$base is stopped" return 3 diff --git a/bacula/platforms/slackware/rc.bacula-dir.in b/bacula/platforms/slackware/rc.bacula-dir.in index 3a613a9e7e..cfd4f3fff8 100644 --- a/bacula/platforms/slackware/rc.bacula-dir.in +++ b/bacula/platforms/slackware/rc.bacula-dir.in @@ -1,7 +1,10 @@ #! /bin/sh # +# Copyright (C) Kern Sibbald 2000-2015 +# License: BSD 2-Clause +# # bacula This shell script takes care of starting and stopping -# the bacula Director daemon +# the bacula Director daemon # # chkconfig: 2345 92 99 # description: The Leading Open Source Backup Solution. @@ -12,42 +15,47 @@ # Source function library . /etc/rc.d/functions.bacula +RETVAL=0 case "$1" in start) - [ -x ${BACDIRBIN}/bacula-dir ] && { - sleep 2 - echo -n "Starting the Director daemon: " - OPTIONS='' - if [ "${DIR_USER}" != '' ]; then - OPTIONS="${OPTIONS} -u ${DIR_USER}" - fi + [ -x ${BACDIRBIN}/bacula-dir ] && { + sleep 2 + echo -n "Starting the Director daemon: " + OPTIONS='' + if [ "${DIR_USER}" != '' ]; then + OPTIONS="${OPTIONS} -u ${DIR_USER}" + fi - if [ "${DIR_GROUP}" != '' ]; then - OPTIONS="${OPTIONS} -g ${DIR_GROUP}" - fi + if [ "${DIR_GROUP}" != '' ]; then + OPTIONS="${OPTIONS} -g ${DIR_GROUP}" + fi - ${BACDIRBIN}/bacula-dir $2 ${OPTIONS} -v -c ${BACDIRCFG}/bacula-dir.conf - echo Done. - } - ;; + ${BACDIRBIN}/bacula-dir $2 ${OPTIONS} -v -c ${BACDIRCFG}/bacula-dir.conf + RETVAL=$? + echo Done. + } + ;; stop) - [ -x ${BACDIRBIN}/bacula-dir ] && { - echo -n "Stopping the Director daemon: " - killproc ${BACDIRBIN}/bacula-dir ${DIR_PORT} - echo Done. - } - ;; + [ -x ${BACDIRBIN}/bacula-dir ] && { + echo -n "Stopping the Director daemon: " + killproc ${BACDIRBIN}/bacula-dir ${DIR_PORT} + RETVAL=$? + echo Done. + } + ;; restart) - $0 stop - sleep 5 - $0 start - ;; + $0 stop + sleep 5 + $0 start + RETVAL=$? + ;; status) - [ -x ${BACDIRBIN}/bacula-dir ] && status ${BACDIRBIN}/bacula-dir ${DIR_PORT} - ;; + [ -x ${BACDIRBIN}/bacula-dir ] && status ${BACDIRBIN}/bacula-dir ${DIR_PORT} + RETVAL=$? + ;; *) - echo "Usage: $0 {start|stop|restart|status}" - exit 1 - ;; + echo "Usage: $0 {start|stop|restart|status}" + exit 1 + ;; esac -exit 0 +exit $RETVAL diff --git a/bacula/platforms/slackware/rc.bacula-fd.in b/bacula/platforms/slackware/rc.bacula-fd.in index 99a3c2db95..d2a66503ae 100644 --- a/bacula/platforms/slackware/rc.bacula-fd.in +++ b/bacula/platforms/slackware/rc.bacula-fd.in @@ -1,7 +1,10 @@ #! /bin/sh # +# Copyright (C) Kern Sibbald 2000-2015 +# License: BSD 2-Clause +# # bacula This shell script takes care of starting and stopping -# the bacula File daemon. +# the bacula File daemon. # # chkconfig: 2345 91 99 # description: The Leading Open Source Backup Solution. @@ -12,42 +15,47 @@ # Source function library . /etc/rc.d/functions.bacula +RETVAL=0 case "$1" in start) - [ -x ${BACFDBIN}/bacula-fd ] && { - sleep 2 - echo -n "Starting the File daemon: " - OPTIONS='' - if [ "${FD_USER}" != '' ]; then - OPTIONS="${OPTIONS} -u ${FD_USER}" - fi + [ -x ${BACFDBIN}/bacula-fd ] && { + sleep 2 + echo -n "Starting the File daemon: " + OPTIONS='' + if [ "${FD_USER}" != '' ]; then + OPTIONS="${OPTIONS} -u ${FD_USER}" + fi - if [ "${FD_GROUP}" != '' ]; then - OPTIONS="${OPTIONS} -g ${FD_GROUP}" - fi + if [ "${FD_GROUP}" != '' ]; then + OPTIONS="${OPTIONS} -g ${FD_GROUP}" + fi - ${BACFDBIN}/bacula-fd $2 ${OPTIONS} -v -c ${BACFDCFG}/bacula-fd.conf - echo Done. - } - ;; + ${BACFDBIN}/bacula-fd $2 ${OPTIONS} -v -c ${BACFDCFG}/bacula-fd.conf + RETVAL=$? + echo Done. + } + ;; stop) - [ -x ${BACFDBIN}/bacula-fd ] && { - echo -n "Stopping the File daemon: " - killproc ${BACFDBIN}/bacula-fd ${FD_PORT} - echo Done. - } - ;; + [ -x ${BACFDBIN}/bacula-fd ] && { + echo -n "Stopping the File daemon: " + killproc ${BACFDBIN}/bacula-fd ${FD_PORT} + RETVAL=$? + echo Done. + } + ;; restart) - $0 stop - sleep 5 - $0 start - ;; + $0 stop + sleep 5 + $0 start + RETVAL=$? + ;; status) - [ -x ${BACFDBIN}/bacula-fd ] && status ${BACFDBIN}/bacula-fd ${FD_PORT} - ;; + [ -x ${BACFDBIN}/bacula-fd ] && status ${BACFDBIN}/bacula-fd ${FD_PORT} + RETVAL=$? + ;; *) - echo "Usage: $0 {start|stop|restart|status}" - exit 1 - ;; + echo "Usage: $0 {start|stop|restart|status}" + exit 1 + ;; esac -exit 0 +exit $RETVAL diff --git a/bacula/platforms/slackware/rc.bacula-sd.in b/bacula/platforms/slackware/rc.bacula-sd.in index 9c77a6ab7e..8841e5b2b6 100644 --- a/bacula/platforms/slackware/rc.bacula-sd.in +++ b/bacula/platforms/slackware/rc.bacula-sd.in @@ -1,7 +1,10 @@ #! /bin/sh # +# Copyright (C) Kern Sibbald 2000-2015 +# License: BSD 2-Clause +# # bacula This shell script takes care of starting and stopping -# the bacula Storage daemon. +# the bacula Storage daemon. # # chkconfig: 2345 90 99 # description: The Leading Open Source Backup Solution. @@ -12,43 +15,47 @@ # Source function library . /etc/rc.d/functions.bacula +RETVAL=0 case "$1" in start) - [ -x ${BACSDBIN}/bacula-sd ] && { - sleep 2 - echo -n "Starting the Storage daemon: " - OPTIONS='' - if [ "${SD_USER}" != '' ]; then - OPTIONS="${OPTIONS} -u ${SD_USER}" - fi + [ -x ${BACSDBIN}/bacula-sd ] && { + sleep 2 + echo -n "Starting the Storage daemon: " + OPTIONS='' + if [ "${SD_USER}" != '' ]; then + OPTIONS="${OPTIONS} -u ${SD_USER}" + fi - if [ "${SD_GROUP}" != '' ]; then - OPTIONS="${OPTIONS} -g ${SD_GROUP}" - fi + if [ "${SD_GROUP}" != '' ]; then + OPTIONS="${OPTIONS} -g ${SD_GROUP}" + fi - ${BACSDBIN}/bacula-sd $2 ${OPTIONS} -v -c ${BACSDCFG}/bacula-sd.conf - echo Done. - } - ;; + ${BACSDBIN}/bacula-sd $2 ${OPTIONS} -v -c ${BACSDCFG}/bacula-sd.conf + RETVAL=$? + echo Done. + } + ;; stop) - [ -x ${BACSDBIN}/bacula-sd ] && { - echo -n "Stopping the Storage daemon: " - killproc ${BACSDBIN}/bacula-sd ${SD_PORT} - echo Done. - } - ;; + [ -x ${BACSDBIN}/bacula-sd ] && { + echo -n "Stopping the Storage daemon: " + killproc ${BACSDBIN}/bacula-sd ${SD_PORT} + RETVAL=$? + echo Done. + } + ;; restart) - $0 stop - sleep 5 - $0 start - ;; + $0 stop + sleep 5 + $0 start + RETVAL=$? + ;; status) - [ -x ${BACSDBIN}/bacula-sd ] && status ${BACSDBIN}/bacula-sd ${SD_PORT} - ;; + [ -x ${BACSDBIN}/bacula-sd ] && status ${BACSDBIN}/bacula-sd ${SD_PORT} + RETVAL=$? + ;; *) - echo "Usage: $0 {start|stop|restart|status}" - exit 1 - ;; + echo "Usage: $0 {start|stop|restart|status}" + exit 1 + ;; esac -exit 0 - +exit $RETVAL diff --git a/bacula/platforms/solaris/Makefile.in b/bacula/platforms/solaris/Makefile.in index 4347e4707b..0e58d39e40 100644 --- a/bacula/platforms/solaris/Makefile.in +++ b/bacula/platforms/solaris/Makefile.in @@ -1,3 +1,6 @@ +# +# Copyright (C) Kern Sibbald 2001-2015 +# License: BSD 2-Clause # # This file is used as the template to create the # Makefile for the Solaris specific installation. @@ -12,7 +15,6 @@ INSTALL = @INSTALL@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_DIR = $(INSTALL) -d -m 755 nothing: @@ -20,28 +22,62 @@ install: install-autostart install-autostart: install-autostart-fd install-autostart-sd install-autostart-dir -install-autostart-%: - @rm -f $(DESTDIR)/etc/rc0.d/K20bacula-$* - @rm -f $(DESTDIR)/etc/rc1.d/S99bacula-$* - @rm -f $(DESTDIR)/etc/rc2.d/S99bacula-$* - @$(INSTALL_DIR) $(DESTDIR)/etc/init.d - @$(INSTALL_DIR) $(DESTDIR)/etc/rc0.d $(DESTDIR)/etc/rc1.d \ - $(DESTDIR)/etc/rc2.d - @$(INSTALL_PROGRAM) -m 744 bacula-$* $(DESTDIR)/etc/init.d/bacula-$* + +install-autostart-fd: + @rm -f /etc/rc0.d/K20bacula-fd + @rm -f /etc/rc1.d/S99bacula-fd + @rm -f /etc/rc2.d/S99bacula-fd + @$(INSTALL_PROGRAM) -m 744 bacula-fd /etc/init.d/bacula-fd + # set symlinks for script at startup and shutdown + @ln -f -s /etc/init.d/bacula-fd /etc/rc0.d/K20bacula-fd + @ln -f -s /etc/init.d/bacula-fd /etc/rc1.d/S99bacula-fd + @ln -f -s /etc/init.d/bacula-fd /etc/rc2.d/S99bacula-fd + + +install-autostart-sd: + @rm -f /etc/rc0.d/K20bacula-sd + @rm -f /etc/rc1.d/S99bacula-sd + @rm -f /etc/rc2.d/S99bacula-sd + @$(INSTALL_PROGRAM) -m 744 bacula-sd /etc/init.d/bacula-sd # set symlinks for script at startup and shutdown - @ln -f -s /etc/init.d/bacula-$* $(DESTDIR)/etc/rc0.d/K20bacula-$* - @ln -f -s /etc/init.d/bacula-$* $(DESTDIR)/etc/rc1.d/S99bacula-$* - @ln -f -s /etc/init.d/bacula-$* $(DESTDIR)/etc/rc2.d/S99bacula-$* + @ln -f -s /etc/init.d/bacula-sd /etc/rc0.d/K20bacula-sd + @ln -f -s /etc/init.d/bacula-sd /etc/rc1.d/S99bacula-sd + @ln -f -s /etc/init.d/bacula-sd /etc/rc2.d/S99bacula-sd + + +install-autostart-dir: + @rm -f /etc/rc0.d/K20bacula-dir + @rm -f /etc/rc1.d/S99bacula-dir + @rm -f /etc/rc2.d/S99bacula-dir + @$(INSTALL_PROGRAM) -m 744 bacula-dir /etc/init.d/bacula-dir + # set symlinks for script at startup and shutdown + @ln -f -s /etc/init.d/bacula-dir /etc/rc0.d/K20bacula-dir + @ln -f -s /etc/init.d/bacula-dir /etc/rc1.d/S99bacula-dir + @ln -f -s /etc/init.d/bacula-dir /etc/rc2.d/S99bacula-dir + uninstall: uninstall-autostart uninstall-autostart: uninstall-autostart-fd uninstall-autostart-sd uninstall-autostart-dir -uninstall-autostart-%: - @rm -f $(DESTDIR)/etc/rc0.d/K20bacula-$* - @rm -f $(DESTDIR)/etc/rc1.d/S99bacula-$* - @rm -f $(DESTDIR)/etc/rc2.d/S99bacula-$* - @rm -f $(DESTDIR)/etc/init.d/bacula-$* +uninstall-autostart-fd: + @rm -f /etc/rc0.d/K20bacula-fd + @rm -f /etc/rc1.d/S99bacula-fd + @rm -f /etc/rc2.d/S99bacula-fd + @rm -f /etc/init.d/bacula-fd + + +uninstall-autostart-sd: + @rm -f /etc/rc0.d/K20bacula-sd + @rm -f /etc/rc1.d/S99bacula-sd + @rm -f /etc/rc2.d/S99bacula-sd + @rm -f /etc/init.d/bacula-sd + +uninstall-autostart-dir: + @rm -f /etc/rc0.d/K20bacula-dir + @rm -f /etc/rc1.d/S99bacula-dir + @rm -f /etc/rc2.d/S99bacula-dir + @rm -f /etc/init.d/bacula-dir clean: @rm -f 1 2 3 diff --git a/bacula/platforms/solaris/bacula-dir.in b/bacula/platforms/solaris/bacula-dir.in index 84df47ecfa..05fc64cca8 100755 --- a/bacula/platforms/solaris/bacula-dir.in +++ b/bacula/platforms/solaris/bacula-dir.in @@ -1,5 +1,8 @@ #!/bin/sh # +# Copyright (C) Kern Sibbald 2000-2015 +# License: BSD 2-Clause +# # bacula This shell script takes care of starting and stopping # the bacula Director daemon # @@ -15,12 +18,12 @@ DIR_OPTIONS='' case "$1" in start) if [ ! -z "${DIR_USER}" ]; then - [ -z "${DIR_OPTIONS}" ] && DIR_OPTIONS="-u ${DIR_USER}" || \ - DIR_OPTIONS="${DIR_OPTIONS} -u ${DIR_USER}" + [ -z "${DIR_OPTIONS}" ] && DIR_OPTIONS="-u ${DIR_USER}" || \ + DIR_OPTIONS="${DIR_OPTIONS} -u ${DIR_USER}" fi if [ ! -z "${DIR_GROUP}" ]; then - [ -z "${DIR_OPTIONS}" ] && DIR_OPTIONS="-g ${DIR_GROUP}" || \ - DIR_OPTIONS="${DIR_OPTIONS} -g ${DIR_GROUP}" + [ -z "${DIR_OPTIONS}" ] && DIR_OPTIONS="-g ${DIR_GROUP}" || \ + DIR_OPTIONS="${DIR_OPTIONS} -g ${DIR_GROUP}" fi echo "Starting the Bacula Director: " @@ -29,16 +32,16 @@ case "$1" in stop) echo "Stopping the Director daemon: " if [ -x /usr/bin/zonename ]; then - case `/usr/bin/zonename` in - global) - pkill -z global -x bacula-dir - ;; - *) - pkill -x bacula-dir - ;; - esac + case `/usr/bin/zonename` in + global) + pkill -z global -x bacula-dir + ;; + *) + pkill -x bacula-dir + ;; + esac else - pkill -x bacula-dir + pkill -x bacula-dir fi ;; restart) diff --git a/bacula/platforms/solaris/bacula-fd.in b/bacula/platforms/solaris/bacula-fd.in index a9eb2044b1..0dca5b4f37 100755 --- a/bacula/platforms/solaris/bacula-fd.in +++ b/bacula/platforms/solaris/bacula-fd.in @@ -1,5 +1,8 @@ #!/bin/sh # +# Copyright (C) Kern Sibbald 2000-2015 +# License: BSD 2-Clause +# # bacula This shell script takes care of starting and stopping # the bacula File daemon. # @@ -15,12 +18,12 @@ FD_OPTIONS='' case "$1" in start) if [ ! -z "${DIR_USER}" ]; then - [ -z "${DIR_OPTIONS}" ] && DIR_OPTIONS="-u ${DIR_USER}" || \ - DIR_OPTIONS="${DIR_OPTIONS} -u ${DIR_USER}" + [ -z "${DIR_OPTIONS}" ] && DIR_OPTIONS="-u ${DIR_USER}" || \ + DIR_OPTIONS="${DIR_OPTIONS} -u ${DIR_USER}" fi if [ ! -z "${DIR_GROUP}" ]; then - [ -z "${DIR_OPTIONS}" ] && DIR_OPTIONS="-g ${DIR_GROUP}" || \ - DIR_OPTIONS="${DIR_OPTIONS} -g ${DIR_GROUP}" + [ -z "${DIR_OPTIONS}" ] && DIR_OPTIONS="-g ${DIR_GROUP}" || \ + DIR_OPTIONS="${DIR_OPTIONS} -g ${DIR_GROUP}" fi echo "Starting the Bacula File daemon: " @@ -29,16 +32,16 @@ case "$1" in stop) echo "Stopping the Bacula File daemon: " if [ -x /usr/bin/zonename ]; then - case `/usr/bin/zonename` in - global) - pkill -z global -x bacula-fd - ;; - *) - pkill -x bacula-fd - ;; - esac + case `/usr/bin/zonename` in + global) + pkill -z global -x bacula-fd + ;; + *) + pkill -x bacula-fd + ;; + esac else - pkill -x bacula-fd + pkill -x bacula-fd fi ;; restart) diff --git a/bacula/platforms/solaris/bacula-sd.in b/bacula/platforms/solaris/bacula-sd.in index 752579e1cb..876ad4bbca 100755 --- a/bacula/platforms/solaris/bacula-sd.in +++ b/bacula/platforms/solaris/bacula-sd.in @@ -1,5 +1,8 @@ #!/bin/sh # +# Copyright (C) Kern Sibbald 2000-2015 +# License: BSD 2-Clause +# # bacula This shell script takes care of starting and stopping # the bacula Storage daemon. # @@ -15,12 +18,12 @@ SD_OPTIONS='' case "$1" in start) if [ ! -z "${DIR_USER}" ]; then - [ -z "${DIR_OPTIONS}" ] && DIR_OPTIONS="-u ${DIR_USER}" || \ - DIR_OPTIONS="${DIR_OPTIONS} -u ${DIR_USER}" + [ -z "${DIR_OPTIONS}" ] && DIR_OPTIONS="-u ${DIR_USER}" || \ + DIR_OPTIONS="${DIR_OPTIONS} -u ${DIR_USER}" fi if [ ! -z "${DIR_GROUP}" ]; then - [ -z "${DIR_OPTIONS}" ] && DIR_OPTIONS="-g ${DIR_GROUP}" || \ - DIR_OPTIONS="${DIR_OPTIONS} -g ${DIR_GROUP}" + [ -z "${DIR_OPTIONS}" ] && DIR_OPTIONS="-g ${DIR_GROUP}" || \ + DIR_OPTIONS="${DIR_OPTIONS} -g ${DIR_GROUP}" fi echo "Starting the Bacula Storage daemon: " @@ -29,16 +32,16 @@ case "$1" in stop) echo "Stopping the Bacula Storage daemon: " if [ -x /usr/bin/zonename ]; then - case `/usr/bin/zonename` in - global) - pkill -z global -x bacula-sd - ;; - *) - pkill -x bacula-sd - ;; - esac + case `/usr/bin/zonename` in + global) + pkill -z global -x bacula-sd + ;; + *) + pkill -x bacula-sd + ;; + esac else - pkill -x bacula-sd + pkill -x bacula-sd fi ;; restart) diff --git a/bacula/platforms/suse/Makefile.in b/bacula/platforms/suse/Makefile.in index f4bbc6738a..4abc3f46aa 100644 --- a/bacula/platforms/suse/Makefile.in +++ b/bacula/platforms/suse/Makefile.in @@ -1,3 +1,6 @@ +# +# Copyright (C) Kern Sibbald 2000-2015 +# License: BSD 2-Clause # # This file is used as the template to create the # Makefile for the SuSe specific installation. diff --git a/bacula/platforms/suse/bacula-dir.in b/bacula/platforms/suse/bacula-dir.in index fc995cb450..0278de854b 100755 --- a/bacula/platforms/suse/bacula-dir.in +++ b/bacula/platforms/suse/bacula-dir.in @@ -1,5 +1,8 @@ #! /bin/sh # +# Copyright (C) Kern Sibbald 2000-2015 +# License: BSD 2-Clause +# # bacula This shell script takes care of starting and stopping # the bacula Director daemon # @@ -7,17 +10,15 @@ # description: The Leading Open Source Backup Solution. # # For Bacula release @VERSION@ (@DATE@) -- @DISTNAME@ -# Copyright (C) 2011 Free Software Foundation Europe e.V. # Modified to work on SuSE 1/31/2004 D. Scott Barninger # Added rc.status functions 3/13/2004 D. Scott Barninger # Added LSB init info 10/14/2004 D. Scott Barninger -# Added $remote_fs, add bacula specific daemon user & group Bruno Friedmann # ### BEGIN INIT INFO # Provides: bacula-dir -# Required-Start: $local_fs $remote_fs $network -# Required-Stop: $local_fs $remote_fs $network -# Default-Start: 3 5 +# Required-Start: $local_fs $network @DEFAULT_DB_TYPE@ +# Required-Stop: $local_fs $network @DEFAULT_DB_TYPE@ +# Default-Start: 3 5 # Default-Stop: 0 1 2 6 # Short-Description: bacula director # Description: Bacula network backup system director daemon @@ -31,7 +32,7 @@ RETVAL=0 case "$1" in start) echo -n "Starting the Bacula Director: " - /sbin/startproc @sbindir@/bacula-dir $2 -u @dir_user@ -g @dir_group@ -c @sysconfdir@/bacula-dir.conf + /sbin/startproc @sbindir@/bacula-dir $2 -c @sysconfdir@/bacula-dir.conf RETVAL=$? rc_status -v echo @@ -49,6 +50,7 @@ case "$1" in $0 stop sleep 5 $0 start + RETVAL=$? ;; status) /sbin/checkproc @sbindir@/bacula-dir diff --git a/bacula/platforms/suse/bacula-fd.in b/bacula/platforms/suse/bacula-fd.in index e8618ddf55..6bfdf33716 100755 --- a/bacula/platforms/suse/bacula-fd.in +++ b/bacula/platforms/suse/bacula-fd.in @@ -1,5 +1,8 @@ #! /bin/sh # +# Copyright (C) Kern Sibbald 2000-2015 +# License: BSD 2-Clause +# # bacula This shell script takes care of starting and stopping # the bacula File daemon. # @@ -7,17 +10,15 @@ # description: The Leading Open Source Backup Solution. # # For Bacula release @VERSION@ (@DATE@) -- @DISTNAME@ -# Copyright (C) 2011 Free Software Foundation Europe e.V. # Modified to work on SuSE 1/31/2004 D. Scott Barninger # Added rc.status functions 3/13/2004 D. Scott Barninger # Added LSB init info 10/14/2004 D. Scott Barninger -# Added $remote_fs, add bacula specific daemon user & group Bruno Friedmann # ### BEGIN INIT INFO # Provides: bacula-fd -# Required-Start: $local_fs $remote_fs $network -# Required-Stop: $local_fs $remote_fs $network -# Default-Start: 3 5 +# Required-Start: $local_fs $network +# Required-Stop: $local_fs $network +# Default-Start: 3 5 # Default-Stop: 0 1 2 6 # Short-Description: bacula file daemon # Description: Bacula network backup system file daemon @@ -27,10 +28,11 @@ # this gives us funtion rc_status -v to tell us if we succeed or fail . /etc/rc.status +RETVAL=0 case "$1" in start) echo -n "Starting the Bacula File daemon: " - /sbin/startproc @sbindir@/bacula-fd $2 -u @fd_user@ -g @fd_group@ -c @sysconfdir@/bacula-fd.conf + /sbin/startproc @sbindir@/bacula-fd $2 -c @sysconfdir@/bacula-fd.conf RETVAL=$? rc_status -v echo @@ -48,6 +50,7 @@ case "$1" in $0 stop sleep 5 $0 start + RETVAL=$? ;; status) /sbin/checkproc @sbindir@/bacula-fd diff --git a/bacula/platforms/suse/bacula-sd.in b/bacula/platforms/suse/bacula-sd.in index 7a61784d58..161e661634 100755 --- a/bacula/platforms/suse/bacula-sd.in +++ b/bacula/platforms/suse/bacula-sd.in @@ -1,5 +1,8 @@ #! /bin/sh # +# Copyright (C) Kern Sibbald 2000-2015 +# License: BSD 2-Clause +# # bacula This shell script takes care of starting and stopping # the bacula Storage daemon. # @@ -7,16 +10,14 @@ # description: The Leading Open Source Backup Solution. # # For Bacula release @VERSION@ (@DATE@) -- @DISTNAME@ -# Copyright (C) 2011 Free Software Foundation Europe e.V. # Modified to work on SuSE 1/31/2004 D. Scott Barninger # Added rc.status functions 3/13/2004 D. Scott Barninger # Added LSB init info 10/14/2004 D. Scott Barninger -# Added $remote_fs, add bacula specific daemon user & group Bruno Friedmann # ### BEGIN INIT INFO # Provides: bacula-sd -# Required-Start: $local_fs $remote_fs $network -# Required-Stop: $local_fs $remote_fs $network +# Required-Start: $local_fs $network +# Required-Stop: $local_fs $network # Default-Start: 3 5 # Default-Stop: 0 1 2 6 # Short-Description: bacula storage daemon @@ -27,10 +28,11 @@ # this gives us funtion rc_status -v to tell us if we succeed or fail . /etc/rc.status +RETVAL=0 case "$1" in start) echo -n "Starting the Bacula Storage daemon: " - /sbin/startproc @sbindir@/bacula-sd $2 -u @sd_user@ -g @sd_group@ -c @sysconfdir@/bacula-sd.conf + /sbin/startproc @sbindir@/bacula-sd $2 -c @sysconfdir@/bacula-sd.conf RETVAL=$? rc_status -v echo @@ -48,6 +50,7 @@ case "$1" in $0 stop sleep 5 $0 start + RETVAL=$? ;; status) /sbin/checkproc @sbindir@/bacula-sd diff --git a/bacula/platforms/suse/bacula.in b/bacula/platforms/suse/bacula.in index 6907794ac2..4b1bfc84cf 100644 --- a/bacula/platforms/suse/bacula.in +++ b/bacula/platforms/suse/bacula.in @@ -1,5 +1,8 @@ #! /bin/sh # +# Copyright (C) Kern Sibbald 2000-2015 +# License: BSD 2-Clause +# # bacula This shell script takes care of starting and stopping # the bacula daemons. # diff --git a/bacula/platforms/systemd/Makefile.in b/bacula/platforms/systemd/Makefile.in index c3da39c347..fc64683902 100644 --- a/bacula/platforms/systemd/Makefile.in +++ b/bacula/platforms/systemd/Makefile.in @@ -1,4 +1,7 @@ # +# Copyright (C) Kern Sibbald 2000-2015 +# License: BSD 2-Clause +# # This file is used as the template to create the # Makefile for the systemd specific installation. # @@ -17,7 +20,7 @@ nothing: install: install-dir install-conf install-autostart -install-dir: $(DESTDIR)/$(SYSTEMD_UNITDIR) +install-dir: mkdir -p $(DESTDIR)/$(SYSTEMD_UNITDIR) $(DESTDIR)/$(SYSTEMD_TMPFILES) install-conf: @@ -25,6 +28,10 @@ install-conf: install-autostart: install-autostart-fd install-autostart-sd install-autostart-dir +install-service: + @$(INSTALL_PROGRAM) -m 644 bacula-fd.service $(DESTDIR)/$(SYSTEMD_UNITDIR) + @$(INSTALL_PROGRAM) -m 644 bacula-dir.service $(DESTDIR)/$(SYSTEMD_UNITDIR) + @$(INSTALL_PROGRAM) -m 644 bacula-sd.service $(DESTDIR)/$(SYSTEMD_UNITDIR) install-autostart-fd: @if test x$(DESTDIR) = x -a -f $(SYSTEMD_UNITDIR)/bacula-fd.service; then \ @@ -104,4 +111,3 @@ distclean: clean devclean: clean @rm -f Makefile bacula-*.spec bacula.*.spec bacula.spec @rm -f bacula.conf bacula-sd.service bacula-fd.service bacula-dir.service - diff --git a/bacula/platforms/systemd/bacula-dir.service.in b/bacula/platforms/systemd/bacula-dir.service.in index 9a82532e29..77921f37f4 100644 --- a/bacula/platforms/systemd/bacula-dir.service.in +++ b/bacula/platforms/systemd/bacula-dir.service.in @@ -1,39 +1,35 @@ -# This file is part of package Bacula Director Daemon +# Systemd Bacula Enterprise service file +# +# Copyright (C) Kern Sibbald 2011-2015 +# License: BSD 2-Clause +# +# /lib/systemd/system/bacula-dir.service # -# Copyright (c) 2011 Free Software Foundation Europe e.V. -# Bacula Community -# Author: Bruno Friedmann # Description: -# Used to start the bacula director daemon service (bacula-dir) -# will be installed as /lib/systemd/system/bacula-dir.service -# enable : systemctl enable bacula-dir.service -# start : systemctl start bacula-dir.service +# Used to start/stop/reload the bacula director daemon service (bacula-dir) +# +# enable : systemctl enable bacula-dir +# start : systemctl start bacula-dir # -# Bacula Director Daemon service # + +# From http://www.freedesktop.org/software/systemd/man/systemd.unit.html [Unit] -Description=Bacula Director Daemon service -Alias=bacula-dir -Requires=var-run.mount nss-lookup.target network.target remote-fs.target syslog.target time-sync.target -After=var-run.mount nss-lookup.target network.target remote-fs.target syslog.target time-sync.target -# Dependency about the database -# We let administrators decide if they need it (if local db instance) -# Wants=@DEFAULT_DB_TYPE@.service -# Check if working dir exist and is a directory -ConditionPathIsDirectory=@working_dir@ -# Before= -# Conflicts= +Description=Bacula Enterprise Director Daemon service +Requires=network.target +After=network.target +RequiresMountsFor=@working_dir@ @sysconfdir@ @sbindir@ @piddir@ +# From http://www.freedesktop.org/software/systemd/man/systemd.service.html [Service] Type=forking User=@dir_user@ Group=@dir_group@ -PIDFile=@piddir@/bacula-dir.@dir_port@.pid -# EnvironmentFile=-/etc/sysconfig/bacula-dir -StandardOutput=syslog ExecStart=@sbindir@/bacula-dir -c @sysconfdir@/bacula-dir.conf -# This daemon should be able to reload the conf file -#ExecReload=/sbin/killproc -p @piddir@/bacula-dir.pid -HUP @sbindir@/bacula-dir +PIDFile=@piddir@/bacula-dir.@dir_port@.pid +ExecReload=@sbindir@/bacula-dir -t -c @sysconfdir@/bacula-dir.conf +ExecReload=/bin/kill -HUP $MAINPID +StandardError=syslog [Install] WantedBy=multi-user.target diff --git a/bacula/platforms/systemd/bacula-fd.service.in b/bacula/platforms/systemd/bacula-fd.service.in index 3efb256628..ae80bb2acf 100644 --- a/bacula/platforms/systemd/bacula-fd.service.in +++ b/bacula/platforms/systemd/bacula-fd.service.in @@ -1,31 +1,33 @@ -# This file is part of package Bacula File Daemon +# Systemd Bacula Enterprise service file +# +# Copyright (C) Kern Sibbald 2011-2015 +# License: BSD 2-Clause +# +# /lib/systemd/system/bacula-fd.service # -# Copyright (c) 2011 Free Software Foundation Europe e.V. -# Bacula Community -# Author: Bruno Friedmann # Description: # Used to start the bacula file daemon service (bacula-fd) -# will be installed as /lib/systemd/system/bacula-fd.service -# enable : systemctl enable bacula-fd.service -# start : systemctl start bacula-fd.service # -# Bacula File Daemon service +# enable : systemctl enable bacula-fd +# start : systemctl start bacula-fd +# # + +# from http://www.freedesktop.org/software/systemd/man/systemd.unit.html [Unit] -Description=Bacula File Daemon service -Requires=var-run.mount nss-lookup.target network.target remote-fs.target syslog.target time-sync.target -After=var-run.mount nss-lookup.target network.target remote-fs.target syslog.target time-sync.target -# Wants= -# Before= -# Conflicts= +Description=Bacula Enterprise File Daemon service +Requires=network.target +After=network.target +RequiresMountsFor=@working_dir@ @sysconfdir@ @sbindir@ @piddir@ +# from http://www.freedesktop.org/software/systemd/man/systemd.service.html [Service] Type=forking User=@fd_user@ Group=@fd_group@ -PIDFile=@piddir@/bacula-fd.@fd_port@.pid -StandardOutput=syslog ExecStart=@sbindir@/bacula-fd -c @sysconfdir@/bacula-fd.conf +PIDFile=@piddir@/bacula-fd.@fd_port@.pid +StandardError=syslog [Install] WantedBy=multi-user.target diff --git a/bacula/platforms/systemd/bacula-sd.service.in b/bacula/platforms/systemd/bacula-sd.service.in index 2d4dc1a519..5c9182eb38 100644 --- a/bacula/platforms/systemd/bacula-sd.service.in +++ b/bacula/platforms/systemd/bacula-sd.service.in @@ -1,32 +1,32 @@ -# This file is part of package Bacula Storage Daemon +# Systemd Bacula Enterprise service file +# +# Copyright (C) Kern Sibbald 2011-2015 +# License: BSD 2-Clause +# +# /lib/systemd/system/bacula-sd.service # -# Copyright (c) 2011 Free Software Foundation Europe e.V. -# for Bacula Community -# Author: Bruno Friedmann # Description: # Used to start the bacula storage daemon service (bacula-sd) -# will be installed as /lib/systemd/system/bacula-sd.service -# enable : systemctl enable bacula-sd.service -# start : systemctl start bacula-sd.service +# enable : systemctl enable bacula-sd +# start : systemctl start bacula-sd # -# Bacula Storage Daemon service # + +# from http://www.freedesktop.org/software/systemd/man/systemd.unit.html [Unit] -Description=Bacula Storage Daemon service -Requires=var-run.mount nss-lookup.target network.target remote-fs.target syslog.target time-sync.target -After=var-run.mount nss-lookup.target network.target remote-fs.target syslog.target time-sync.target -# Wants= -# Before= -# Conflicts= +Description=Bacula Enterprise Storage Daemon service +Requires=network.target +After=network.target +RequiresMountsFor=@working_dir@ @sysconfdir@ @sbindir@ @piddir@ +# from http://www.freedesktop.org/software/systemd/man/systemd.service.html [Service] Type=forking User=@sd_user@ Group=@sd_group@ -PIDFile=@piddir@/bacula-sd.@sd_port@.pid -# EnvironmentFile=-/etc/sysconfig/bacula-sd -StandardOutput=syslog ExecStart=@sbindir@/bacula-sd -c @sysconfdir@/bacula-sd.conf +PIDFile=@piddir@/bacula-sd.@sd_port@.pid +StandardError=syslog [Install] WantedBy=multi-user.target diff --git a/bacula/platforms/unknown/Makefile.in b/bacula/platforms/unknown/Makefile.in index 124b381fdf..89cfbb5674 100644 --- a/bacula/platforms/unknown/Makefile.in +++ b/bacula/platforms/unknown/Makefile.in @@ -1,3 +1,6 @@ +# +# Copyright (C) Kern Sibbald 2000-2015 +# License: BSD 2-Clause # # This file is used as the template to create the # Makefile for the unknown specific installation.