diff --git a/.travis.yml b/.travis.yml index b6d00b38506..41dd733af1f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -54,6 +54,7 @@ before_script: - if [ "${COVERITY_SCAN}" = '1' ]; then eval "$COVERITY_SCAN_BUILD"; else make; fi - for script in $PWD/debian/bareos*.preinst; do echo "$script"; sudo /bin/sh $script install; done - sudo make install + - sudo make install-autostart - for script in $PWD/debian/bareos*.postinst; do echo "$script"; sudo /bin/sh $script configure; done # test script diff --git a/autoconf/configure.in b/autoconf/configure.in index ffaa08f7b59..a1e50cd7bfd 100644 --- a/autoconf/configure.in +++ b/autoconf/configure.in @@ -3752,11 +3752,8 @@ debian) TAPEDRIVE="/dev/nst0" PSCMD="ps -e -o pid,command" PFILES="${PFILES} \ - platforms/debian/Makefile \ - platforms/debian/bareos-fd \ - platforms/debian/bareos-sd \ - platforms/debian/bareos-dir \ - platforms/debian/set_dbconfig_vars.sh" + platforms/debian/Makefile \ + platforms/debian/set_dbconfig_vars.sh" ;; freebsd) VER=`echo $DISTVER | cut -c 1` @@ -3906,12 +3903,9 @@ ubuntu) TAPEDRIVE="/dev/nst0" PSCMD="ps -e -o pid,command" PFILES="${PFILES} \ - platforms/ubuntu/Makefile \ - platforms/debian/Makefile \ - platforms/debian/bareos-fd \ - platforms/debian/bareos-sd \ - platforms/debian/bareos-dir \ - platforms/debian/set_dbconfig_vars.sh" + platforms/ubuntu/Makefile \ + platforms/debian/Makefile \ + platforms/debian/set_dbconfig_vars.sh" ;; univention) TAPEDRIVE="/dev/nst0" @@ -3919,9 +3913,6 @@ univention) PFILES="${PFILES} \ platforms/univention/Makefile \ platforms/debian/Makefile \ - platforms/debian/bareos-fd \ - platforms/debian/bareos-sd \ - platforms/debian/bareos-dir \ platforms/debian/set_dbconfig_vars.sh" ;; unknown) @@ -4004,8 +3995,11 @@ manpages/Makefile \ debian/bareos-common.preinst \ debian/bareos-database-common.config \ debian/bareos-database-common.postinst \ +debian/bareos-filedaemon.bareos-fd.init \ debian/bareos-filedaemon.preinst \ +debian/bareos-director.bareos-dir.init \ debian/bareos-director.preinst \ +debian/bareos-storage.bareos-sd.init \ debian/bareos-storage.preinst \ scripts/bareos-config \ scripts/bareos-config-lib.sh \ diff --git a/platforms/debian/bareos-dir.in b/debian/bareos-director.bareos-dir.init.in similarity index 100% rename from platforms/debian/bareos-dir.in rename to debian/bareos-director.bareos-dir.init.in diff --git a/debian/bareos-director.install b/debian/bareos-director.install index 725fa1781b5..62287c5332a 100644 --- a/debian/bareos-director.install +++ b/debian/bareos-director.install @@ -1,6 +1,5 @@ /etc/bareos/bareos-dir.conf /etc/logrotate.d/bareos-dir -/etc/init.d/bareos-dir /usr/lib/bareos/scripts/delete_catalog_backup /usr/lib/bareos/scripts/make_catalog_backup /usr/lib/bareos/scripts/make_catalog_backup.pl diff --git a/debian/bareos-director.postinst b/debian/bareos-director.postinst index c399a18ea9e..550280cd63d 100644 --- a/debian/bareos-director.postinst +++ b/debian/bareos-director.postinst @@ -31,11 +31,6 @@ permissions() chown ${director_daemon_user}:${daemon_group} /etc/bareos/bareos-dir.conf } -enable_rc_scripts() -{ - update-rc.d bareos-dir defaults -} - case "$1" in configure) permissions @@ -43,7 +38,6 @@ case "$1" in /usr/lib/bareos/scripts/bareos-config initialize_passwords /usr/lib/bareos/scripts/bareos-config initialize_database_driver /usr/lib/bareos/scripts/bareos-config apply_dbconfig_settings - enable_rc_scripts ;; abort-upgrade|abort-remove|abort-deconfigure) ;; diff --git a/debian/bareos-director.prerm b/debian/bareos-director.prerm index 6fde72caca9..fde9112e976 100644 --- a/debian/bareos-director.prerm +++ b/debian/bareos-director.prerm @@ -16,14 +16,8 @@ set -e # for details, see http://www.debian.org/doc/debian-policy/ or # the debian-policy package -disable_rc_scripts() -{ - update-rc.d -f bareos-dir remove -} - case "$1" in remove|deconfigure) - disable_rc_scripts ;; failed-upgrade|upgrade) ;; diff --git a/platforms/debian/bareos-fd.in b/debian/bareos-filedaemon.bareos-fd.init.in similarity index 100% rename from platforms/debian/bareos-fd.in rename to debian/bareos-filedaemon.bareos-fd.init.in diff --git a/debian/bareos-filedaemon.install b/debian/bareos-filedaemon.install index a9538b3793c..b47229d7550 100644 --- a/debian/bareos-filedaemon.install +++ b/debian/bareos-filedaemon.install @@ -1,4 +1,3 @@ /etc/bareos/bareos-fd.conf -/etc/init.d/bareos-fd /usr/sbin/bareos-fd /usr/share/man/man8/bareos-fd.8.gz diff --git a/debian/bareos-filedaemon.postinst b/debian/bareos-filedaemon.postinst index 16e7d8fae31..cfcf819d09a 100644 --- a/debian/bareos-filedaemon.postinst +++ b/debian/bareos-filedaemon.postinst @@ -31,17 +31,11 @@ permissions() chown ${file_daemon_user}:${daemon_group} /etc/bareos/bareos-fd.conf } -enable_rc_scripts() -{ - update-rc.d bareos-fd defaults -} - case "$1" in configure) permissions /usr/lib/bareos/scripts/bareos-config initialize_local_hostname /usr/lib/bareos/scripts/bareos-config initialize_passwords - enable_rc_scripts ;; abort-upgrade|abort-remove|abort-deconfigure) diff --git a/debian/bareos-filedaemon.prerm b/debian/bareos-filedaemon.prerm index 48d93a0b840..fde9112e976 100644 --- a/debian/bareos-filedaemon.prerm +++ b/debian/bareos-filedaemon.prerm @@ -16,14 +16,8 @@ set -e # for details, see http://www.debian.org/doc/debian-policy/ or # the debian-policy package -disable_rc_scripts() -{ - update-rc.d -f bareos-fd remove -} - case "$1" in remove|deconfigure) - disable_rc_scripts ;; failed-upgrade|upgrade) ;; diff --git a/platforms/debian/bareos-sd.in b/debian/bareos-storage.bareos-sd.init.in similarity index 100% rename from platforms/debian/bareos-sd.in rename to debian/bareos-storage.bareos-sd.init.in diff --git a/debian/bareos-storage.install b/debian/bareos-storage.install index 5727e8119fc..73893678226 100644 --- a/debian/bareos-storage.install +++ b/debian/bareos-storage.install @@ -1,5 +1,4 @@ /etc/bareos/bareos-sd.conf -/etc/init.d/bareos-sd /usr/sbin/bscrypto /usr/lib/bareos/plugins/scsicrypto-sd.so /usr/lib/bareos/scripts/disk-changer diff --git a/debian/bareos-storage.postinst b/debian/bareos-storage.postinst index 252d105c58b..e16d28939d5 100644 --- a/debian/bareos-storage.postinst +++ b/debian/bareos-storage.postinst @@ -32,18 +32,12 @@ permissions() chown ${storage_daemon_user}:${daemon_group} /var/lib/bareos/storage/ } -enable_rc_scripts() -{ - update-rc.d bareos-sd defaults -} - case "$1" in configure) permissions /usr/lib/bareos/scripts/bareos-config setup_sd_user /usr/lib/bareos/scripts/bareos-config initialize_local_hostname /usr/lib/bareos/scripts/bareos-config initialize_passwords - enable_rc_scripts ;; abort-upgrade|abort-remove|abort-deconfigure) diff --git a/debian/bareos-storage.prerm b/debian/bareos-storage.prerm index b88ae3c3b35..fde9112e976 100644 --- a/debian/bareos-storage.prerm +++ b/debian/bareos-storage.prerm @@ -16,14 +16,8 @@ set -e # for details, see http://www.debian.org/doc/debian-policy/ or # the debian-policy package -disable_rc_scripts() -{ - update-rc.d -f bareos-sd remove -} - case "$1" in remove|deconfigure) - disable_rc_scripts ;; failed-upgrade|upgrade) ;; diff --git a/debian/rules b/debian/rules index ca05209a107..f552879300d 100644 --- a/debian/rules +++ b/debian/rules @@ -83,6 +83,10 @@ override_dh_fixperms: override_dh_strip: dh_strip --dbg-package=bareos-dbg +override_dh_installinit: + dh_installinit --package=bareos-director --name=bareos-dir --no-start + dh_installinit --package=bareos-storage --name=bareos-sd --no-start + dh_installinit --package=bareos-filedaemon --name=bareos-fd + %: dh $@ - diff --git a/debian/univention-bareos-schema.postinst b/debian/univention-bareos-schema.postinst index c85e3df360d..01152cd5d64 100644 --- a/debian/univention-bareos-schema.postinst +++ b/debian/univention-bareos-schema.postinst @@ -2,8 +2,12 @@ . /usr/share/univention-lib/all.sh if [ "$1" = "configure" ]; then - - ucs_registerLDAPSchema /usr/share/univention-bareos-schema/univention-bareos.schema + ucs_registerLDAPSchema /usr/share/univention-bareos-schema/univention-bareos.schema fi +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + exit 0 diff --git a/debian/univention-bareos.postinst b/debian/univention-bareos.postinst index 570e0088a11..1581c88ae42 100644 --- a/debian/univention-bareos.postinst +++ b/debian/univention-bareos.postinst @@ -3,8 +3,6 @@ . /usr/share/debconf/confmodule . /usr/share/dbconfig-common/dpkg/postinst.pgsql -#DEBHELPER# - dbc_pgsql_createdb_encoding="SQL_ASCII" dbc_go univention-bareos $@ @@ -15,56 +13,59 @@ exec 3>/dev/null # ... rest of your code ... if [ "$1" = "configure" ]; then - # on upgrade, set backup_myself to yes if it was not set - filestorage=$(ucr get bareos/filestorage) - backup_myself=$(ucr get bareos/backup_myself) - if [ -n "$filestorage" -a -z "$backup_myself" ] - then - ucr set bareos/backup_myself=yes - fi - - # defaults - ucr set \ - bareos/pgsql/user?bareos \ - bareos/pgsql/database?bareos \ - bareos/filestorage?/var/lib/bareos/storage \ - bareos/max_incr_volumes?1 \ - bareos/max_diff_volumes?1 \ - bareos/max_full_volumes?1 \ - bareos/backup_myself?no - - ucr commit /etc/bareos/bareos-dir.conf /etc/bareos/bareos-sd.conf \ - /etc/bareos/bareos-fd.conf /etc/bareos/bconsole.conf \ - /etc/postgresql/8.4/main/pg_hba.conf - - touch /etc/bareos/autogenerated/clients.include - - chmod go-rwx /etc/bareos/autogenerated/fd-secrets - chmod go-rwx /etc/bareos/autogenerated/fd-configs - - # activate our listener plugin - invoke-rc.d univention-directory-listener restart - - # reload is sufficient for postgres to reload the pg_hba.conf file - invoke-rc.d postgresql reload - - # restart bareos - invoke-rc.d bareos-dir restart - invoke-rc.d bareos-sd restart - invoke-rc.d bareos-fd restart - - - # firewall exceptions - ucr set \ - security/packetfilter/package/univention-bareos/tcp/9101/all="ACCEPT" \ - security/packetfilter/package/univention-bareos/tcp/9101/all/en="bareos-dir" \ - security/packetfilter/package/univention-bareos/tcp/9102/all="ACCEPT" \ - security/packetfilter/package/univention-bareos/tcp/9102/all/en="bareos-fd" \ - security/packetfilter/package/univention-bareos/tcp/9103/all="ACCEPT" \ - security/packetfilter/package/univention-bareos/tcp/9103/all/en="bareos-sd" - [ -x "/etc/init.d/univention-firewall" ] && invoke-rc.d univention-firewall restart - - call_joinscript 62univention-bareos.inst + # on upgrade, set backup_myself to yes if it was not set + filestorage=$(ucr get bareos/filestorage) + backup_myself=$(ucr get bareos/backup_myself) + if [ -n "$filestorage" -a -z "$backup_myself" ]; then + ucr set bareos/backup_myself=yes + fi + + # defaults + ucr set \ + bareos/pgsql/user?bareos \ + bareos/pgsql/database?bareos \ + bareos/filestorage?/var/lib/bareos/storage \ + bareos/max_incr_volumes?1 \ + bareos/max_diff_volumes?1 \ + bareos/max_full_volumes?1 \ + bareos/backup_myself?no + + ucr commit /etc/bareos/bareos-dir.conf /etc/bareos/bareos-sd.conf \ + /etc/bareos/bareos-fd.conf /etc/bareos/bconsole.conf \ + /etc/postgresql/8.4/main/pg_hba.conf + + touch /etc/bareos/autogenerated/clients.include + + chmod go-rwx /etc/bareos/autogenerated/fd-secrets + chmod go-rwx /etc/bareos/autogenerated/fd-configs + + # activate our listener plugin + invoke-rc.d univention-directory-listener restart + + # reload is sufficient for postgres to reload the pg_hba.conf file + invoke-rc.d postgresql reload + + # restart bareos + invoke-rc.d bareos-dir restart + invoke-rc.d bareos-sd restart + invoke-rc.d bareos-fd restart + + # firewall exceptions + ucr set \ + security/packetfilter/package/univention-bareos/tcp/9101/all="ACCEPT" \ + security/packetfilter/package/univention-bareos/tcp/9101/all/en="bareos-dir" \ + security/packetfilter/package/univention-bareos/tcp/9102/all="ACCEPT" \ + security/packetfilter/package/univention-bareos/tcp/9102/all/en="bareos-fd" \ + security/packetfilter/package/univention-bareos/tcp/9103/all="ACCEPT" \ + security/packetfilter/package/univention-bareos/tcp/9103/all/en="bareos-sd" + [ -x "/etc/init.d/univention-firewall" ] && invoke-rc.d univention-firewall restart + + call_joinscript 62univention-bareos.inst fi +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + exit 0 diff --git a/debian/univention-bareos.postrm b/debian/univention-bareos.postrm index d929335f60c..d5d4f977562 100644 --- a/debian/univention-bareos.postrm +++ b/debian/univention-bareos.postrm @@ -3,8 +3,6 @@ set -e #set -x -#DEBHELPER# - if [ -f /usr/share/debconf/confmodule ]; then . /usr/share/debconf/confmodule fi @@ -25,3 +23,10 @@ if [ "$1" = "remove" ]; then call_unjoinscript 63univention-bareos-uninstall.uinst joinscript_remove_script_from_status_file univention-bareos fi + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 diff --git a/debian/univention-bareos.preinst b/debian/univention-bareos.preinst index 8088519956f..b3591538421 100644 --- a/debian/univention-bareos.preinst +++ b/debian/univention-bareos.preinst @@ -1,9 +1,12 @@ #!/bin/sh -#DEBHELPER# - if [ "$1" = "install" ]; then test -e /usr/lib/univention-install/63univention-bareos-uninstall.uinst && rm /usr/lib/univention-install/63univention-bareos-uninstall.uinst fi +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + exit 0 diff --git a/debian/univention-bareos.prerm b/debian/univention-bareos.prerm index 6e39dfe7fd3..0cd12537502 100644 --- a/debian/univention-bareos.prerm +++ b/debian/univention-bareos.prerm @@ -1,22 +1,23 @@ #!/bin/sh #set -x - - set -e . /usr/share/debconf/confmodule . /usr/share/dbconfig-common/dpkg/prerm.pgsql dbc_go univention-bareos $@ +if [ "$1" = remove ]; then + invoke-rc.d bareos-dir stop || true + file="/usr/lib/univention-uninstall/63univention-bareos.uinst" + if [ -r "$file" ]; then + cp "$file" /usr/lib/univention-install/ + fi +fi + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + #DEBHELPER# -if [ "$1" = remove ] -then - invoke-rc.d bareos-dir stop || true - file="/usr/lib/univention-uninstall/63univention-bareos.uinst" - if [ -r "$file" ] - then - cp "$file" /usr/lib/univention-install/ - fi -fi +exit 0 diff --git a/platforms/debian/Makefile.in b/platforms/debian/Makefile.in index 67e3a27e75d..a855bfc33ee 100644 --- a/platforms/debian/Makefile.in +++ b/platforms/debian/Makefile.in @@ -10,7 +10,7 @@ nothing: -install: install-autostart install_logrotate install-dbconfig +install: install_logrotate install-dbconfig install-autostart: install-autostart-fd install-autostart-sd install-autostart-dir @@ -21,28 +21,28 @@ install_logrotate: install-autostart-fd: @echo "Installing bareos-fd boot script ..." @$(MKDIR) $(DESTDIR)/etc/init.d - @$(INSTALL_PROGRAM) bareos-fd $(DESTDIR)/etc/init.d/bareos-fd + @$(INSTALL_PROGRAM) ../../debian/bareos-filedaemon.bareos-fd.init $(DESTDIR)/etc/init.d/bareos-fd @echo "Installing bareos-fd symlinks ..." @if test x$(DESTDIR) = x ; then \ - /usr/sbin/update-rc.d bareos-fd start 91 2 3 4 5 . stop 9 0 1 6 .; \ + /usr/sbin/update-rc.d bareos-fd defaults; \ fi install-autostart-sd: @echo "Installing bareos-sd boot script ..." @$(MKDIR) $(DESTDIR)/etc/init.d - @$(INSTALL_PROGRAM) bareos-sd $(DESTDIR)/etc/init.d/bareos-sd + @$(INSTALL_PROGRAM) ../../debian/bareos-storage.bareos-sd.init $(DESTDIR)/etc/init.d/bareos-sd @echo "Installing bareos-sd symlinks ..." @if test "x$(DESTDIR)" = "x" ; then \ - /usr/sbin/update-rc.d bareos-sd start 91 2 3 4 5 . stop 9 0 1 6 .; \ + /usr/sbin/update-rc.d bareos-sd defaults; \ fi install-autostart-dir: @echo "Installing bareos-dir boot script ..." @$(MKDIR) $(DESTDIR)/etc/init.d - @$(INSTALL_PROGRAM) bareos-dir $(DESTDIR)/etc/init.d/bareos-dir + @$(INSTALL_PROGRAM) ../../debian/bareos-director.bareos-dir.init $(DESTDIR)/etc/init.d/bareos-dir @echo "Installing bareos-dir symlinks ..." @if test "x$(DESTDIR)" = "x" ; then \ - /usr/sbin/update-rc.d bareos-dir start 90 2 3 4 5 . stop 9 0 1 6 .; \ + /usr/sbin/update-rc.d bareos-dir defaults; \ fi install-dbconfig: @@ -64,8 +64,6 @@ clean: distclean: clean @$(RMF) Makefile - @$(RMF) bareos-sd bareos-fd bareos-dir devclean: clean @$(RMF) Makefile - @$(RMF) bareos-sd bareos-fd bareos-dir diff --git a/platforms/packaging/bareos.spec b/platforms/packaging/bareos.spec index 43c84401779..30119f7a219 100644 --- a/platforms/packaging/bareos.spec +++ b/platforms/packaging/bareos.spec @@ -128,6 +128,7 @@ BuildRequires: postgresql-devel BuildRequires: libqt4-devel BuildRequires: openssl BuildRequires: libcap-devel +BuildRequires: lsb-release BuildRequires: mtx %if 0%{?suse_version} @@ -138,19 +139,6 @@ BuildRequires: pwdutils BuildRequires: tcpd-devel BuildRequires: update-desktop-files -# Some magic to be able to determine what platform we are running on. -%if !0%{sles_version} -BuildRequires: openSUSE-release -%else -%if 0%{?sles_version} && !0%{?sled_version} -BuildRequires: sles-release -%else -BuildRequires: sled-release -%endif -%endif - -BuildRequires: lsb-release - %else BuildRequires: qt4-devel BuildRequires: libtermcap-devel @@ -1032,15 +1020,15 @@ if [ "$1" = 0 ]; then fi %postun director -if [ "$1" -ge "1" ]; then -%restart_on_update bareos-dir -fi +#if [ "$1" -ge "1" ]; then +#restart_on_update bareos-dir +#fi %insserv_cleanup %postun storage -if [ "$1" -ge "1" ]; then -%restart_on_update bareos-sd -fi +#if [ "$1" -ge "1" ]; then +#restart_on_update bareos-sd +#fi %insserv_cleanup %postun filedaemon