Summary: | [MAINTAINER-UPDATE] sysutils/bacula-server upgrade to latest version | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Product: | Ports & Packages | Reporter: | Dan Langille <dan> | ||||||||||
Component: | Individual Port(s) | Assignee: | Ruslan Makhmatkhanov <rm> | ||||||||||
Status: | Closed FIXED | ||||||||||||
Severity: | Affects Only Me | CC: | dan | ||||||||||
Priority: | Normal | ||||||||||||
Version: | Latest | ||||||||||||
Hardware: | Any | ||||||||||||
OS: | Any | ||||||||||||
Attachments: |
|
Description
Dan Langille
2013-03-24 05:10:00 UTC
Responsible Changed From-To: freebsd-ports-bugs->rm I will take it. State Changed From-To: open->feedback Hi Dan, your patch miss pkg-plist's entry for removing %%PREFIX%%/etc/bacula at deinstall. This failing both with bacula-server and bacula-client. Would you please fix? Here is the log: http://people.freebsd.org/~rm/bacula-server-5.2.12_1.log I have no idea why /usr/local/etc/bacula is not removed. The port does install files there. Those files are moved during the deinstall. The directory in question is indeed empty. No . files etc. pkg-plist and pkg-plist.client both contain: @dirrmtry %%ETCDIR%% Anyone else have ideas why this is failing? -- Dan Langille - http://langille.org/ Hi Dan, please note that the patch in this PR does not contain any changes to pkg-plist or pkg-plist.client, and the files currently in the tree do not contain "@dirrmtry %%ETCDIR%%". If you have that in your files locally, it's missing from the patch, and noone else can test it. (I think that's what rm meant, too.) Best regards, Stefan Thank you Stefan. attached is the patch, but it's combined with PYTHON changes from ports/171818 which also does not work. NOTE: my time in the weeks before BSDCan is limited. Hi Dan, here's the tail of /var/db/pkg/bacula-server-5.2.12_1/+CONTENTS after I installed the patched port: ---snip--- @comment MD5:359e4fe1f7fe9961e3739d3ea1582e53 share/bacula/update_bacula_tables @comment MD5:12789b95fd27a1d900a219dd4f35e5ea share/bacula/update_postgresql_tables @comment MD5:fc90b202edbb92a39fd77ca5e802282d @dirrm share/bacula @unexec /usr/bin/killall bacula-sd > /dev/null 2>&1 || true @unexec /usr/bin/killall bacula-dir > /dev/null 2>&1 || true @exec mkdir -p /var/db/bacula @unexec rmdir "%D//var/db/bacula" 2>/dev/null || true @unexec rmdir "%D/etc/bacula" 2>/dev/null || true @exec /sbin/ldconfig -m /tmp/portprefix/lib @unexec /sbin/ldconfig -R @comment OPTIONS:-MTX -MYSQL +NLS +OPENSSL +PGSQL -PYTHON -SQLITE3 @unexec if /usr/sbin/pw usershow bacula >/dev/null 2>&1; then echo "==> You should manually remove the \"bacula\" user. "; fi @cwd /tmp/portprefix etc/rc.d/bacula-dir @comment MD5:f2419e604a6139bad35c2356f6c70c06 etc/rc.d/bacula-sd @comment MD5:919d5f57544027857568dba35414ce3b etc/bacula/bacula-barcodes.samples @comment MD5:5461de51ff8cc897bd9b502a001c11f5 etc/bacula/bacula-sd.conf.sample @comment MD5:a97dcc68cf94002e120594216ae8d2e1 etc/bacula/bacula-dir.conf.sample @comment MD5:8ba2aaba317701c60f7d5aa47e0f6e84 @unexec rmdir %D 2> /dev/null || true @display +DISPLAY ---snip--- Note that, as you're appending them to ${TMPPLIST} in the Makefile, the sample files (etc/bacula/*.sample) come after the line trying to remove etc/bacula/, which is part of the static plist. Thus, when the package is being deinstalled and etc/bacula/ should be removed, the sample files are still there and the removal of the directory fails. The sample files are removed only afterwards. A solution might be to dynamically add the line for removal of etc/bacula/ to the plist via the Makefile, too - after the sample files have been added. I haven't looked at the Python problem, and I'm not sure if I can provide any help there. I'd try to do one thing at a time, though, and leave that one for later. :-) Best regards, Stefan Hi Dan,
Dan Langille, 30.04.13, 17:44h CEST:
> attached is the patch, but it's combined with PYTHON changes from ports/171818 which also does not work.
>
> NOTE: my time in the weeks before BSDCan is limited.
I just noticed that, in the GNATS web frontend, my reply to your mail was
truncated, so I'm repeating that part just to ensure it gets displayed:
[...tail of /var/db/pkg/bacula-server-5.2.12_1/+CONTENTS...]
Note that, as you're appending them to ${TMPPLIST} in the Makefile, the
sample files (etc/bacula/*.sample) come after the line trying to remove
etc/bacula/, which is part of the static plist. Thus, when the package is
being deinstalled and etc/bacula/ should be removed, the sample files are
still there and the removal of the directory fails. The sample files are
removed only afterwards.
A solution might be to dynamically add the line for removal of etc/bacula/
to the plist via the Makefile, too - after the sample files have been
added.
I haven't looked at the Python problem, and I'm not sure if I can provide
any help there. I'd try to do one thing at a time, though, and leave that
one for later. :-)
Best regards,
Stefan
Author: rm Date: Fri Jul 19 09:44:58 2013 New Revision: 323275 URL: http://svnweb.freebsd.org/changeset/ports/323275 Log: - move bacula configuration to ${ETCDIR}/bacula - bump PORTREVISION - add UPDATING entry - add an option to enable python support (both client and server need to be rebuilt with this) Dan's submission is based on: PR: 170882 Submitted by: Michael Carlson <mike@bayphoto.com> PR: 171818 Submitted by: Florian Ermisch <floh.edo@googlemail.com> PR: 177331 Submitted by: Dan Langille <dan@langille.org> (maintainer) Modified: head/UPDATING head/sysutils/bacula-client/Makefile head/sysutils/bacula-server/Makefile head/sysutils/bacula-server/Makefile.common head/sysutils/bacula-server/files/bacula-dir.in head/sysutils/bacula-server/files/bacula-fd.in head/sysutils/bacula-server/files/bacula-sd.in head/sysutils/bacula-server/files/chio-bacula head/sysutils/bacula-server/files/pkg-message.client.in head/sysutils/bacula-server/files/pkg-message.server.in Modified: head/UPDATING ============================================================================== --- head/UPDATING Fri Jul 19 09:19:53 2013 (r323274) +++ head/UPDATING Fri Jul 19 09:44:58 2013 (r323275) @@ -5,6 +5,14 @@ they are unavoidable. You should get into the habit of checking this file for changes each time you update your ports collection, before attempting any port upgrades. +20130719: + AFFECTS: users of sysutils/bacula-server, sysutils/bacula-client, sysutils/bat + AUTHOR: dvl@FreeBSD.org + + The configuration files for bacula have been moved to PREFIX/bacula. + Moveyour existing configuration files to this directory after + upgrading. + 20130718: AFFECTS: users of security/logcheck AUTHOR: glarkin@FreeBSD.org Modified: head/sysutils/bacula-client/Makefile ============================================================================== --- head/sysutils/bacula-client/Makefile Fri Jul 19 09:19:53 2013 (r323274) +++ head/sysutils/bacula-client/Makefile Fri Jul 19 09:44:58 2013 (r323275) @@ -11,7 +11,7 @@ USE_RC_SUBR= bacula-fd PLIST= ${PKGDIR}/pkg-plist.client MASTERDIR= ${.CURDIR}/../../sysutils/bacula-server -OPTIONS_DEFINE= NLS OPENSSL +OPTIONS_DEFINE= NLS OPENSSL PYTHON OPTIONS_DEFAULT=NLS OPENSSL .include "${MASTERDIR}/Makefile" Modified: head/sysutils/bacula-server/Makefile ============================================================================== --- head/sysutils/bacula-server/Makefile Fri Jul 19 09:19:53 2013 (r323274) +++ head/sysutils/bacula-server/Makefile Fri Jul 19 09:44:58 2013 (r323275) @@ -3,7 +3,7 @@ PORTNAME= bacula DISTVERSION= 5.2.12 -PORTREVISION?= 0 +PORTREVISION?= 1 CATEGORIES?= sysutils MASTER_SITES= SF/bacula/bacula/${PORTVERSION} PKGNAMEPREFIX?= # @@ -25,7 +25,7 @@ USE_LDCONFIG= yes CPPFLAGS+= -I/usr/include/readline -I${LOCALBASE}/include LDFLAGS+= -L${LOCALBASE}/lib -OPTIONS_DEFINE?= SQLITE3 MYSQL PGSQL MTX NLS OPENSSL +OPTIONS_DEFINE?= SQLITE3 MYSQL PGSQL MTX PYTHON NLS OPENSSL OPTIONS_DEFAULT?= NLS OPENSSL PGSQL MTX_DESC= Install mtx for control of autochanger devices @@ -33,6 +33,11 @@ MTX_DESC= Install mtx for control of au .if ${PKGNAMESUFFIX} == "-client" || ${PKGNAMESUFFIX} == "-server" #Till end of the file +.if defined(WITH_PYTHON) +USE_PYTHON= yes +CONFIGURE_ARGS+= --with-python=yes +.endif + .if !defined(WITH_CLIENT_ONLY) LIB_DEPENDS+= bac:${PORTSDIR}/sysutils/bacula-client USE_RC_SUBR?= bacula-dir bacula-sd @@ -47,6 +52,7 @@ SUB_FILES+= pkg-install.server pkg-deins MANCOMPRESSED= yes CONFIGURE_ARGS+=--with-tcp-wrappers=/usr/lib \ --enable-smartalloc \ + --sysconfdir=${ETCDIR} \ --with-working-dir=${BACULA_DIR} \ --with-scriptdir=${PREFIX}/share/${PORTNAME} \ --with-readline=yes \ @@ -154,6 +160,7 @@ pre-everything:: @${ECHO_MSG} "" @${ECHO_MSG} " WITH_CLIENT_ONLY=yes if you only want the file daemon." @${ECHO_MSG} " WITH_MTX=yes if you want to use mtx instead of chio for autochanger control." + @${ECHO_MSG} " WITH_PYTHON=yes Enable Python scripting in the director." @${ECHO_MSG} " WITH_SQLITE3=yes if you want SQLite-3 as the database (not recommended)." .if ! ${PORT_OPTIONS:MMYSQL} && ! ${PORT_OPTIONS:MPGSQL} @${ECHO_MSG} " WITH_MYSQL=yes if you want MySQL as the database." @@ -173,8 +180,8 @@ post-patch: # Change $(ECHO) to echo in some Makefile.in files @${REINPLACE_CMD} -e 's|$$(ECHO)|echo|g' ${WRKSRC}/src/filed/Makefile.in \ ${WRKSRC}/src/console/Makefile.in -# Default bconsole.conf is ${PREFIX}/etc - @${REINPLACE_CMD} -e 's|./bconsole.conf|${PREFIX}/etc/bconsole.conf|g' ${WRKSRC}/src/console/console.c +# Default bconsole.conf is in ${ETCDIR} + @${REINPLACE_CMD} -e 's|./bconsole.conf|${ETCDIR}/bconsole.conf|g' ${WRKSRC}/src/console/console.c @${REINPLACE_CMD} -e 's|^MAN8 =|MAN8 ?=|g' -e 's|^MAN1 =|MAN1 ?=|g' ${WRKSRC}/manpages/Makefile.in .if defined(WITH_CLIENT_ONLY) # In client port only install startup script out of script dir (see below post-install) @@ -212,13 +219,13 @@ post-install: @ ${SETENV} PKG_PREFIX=${PREFIX} \ ${SH} ${PKGINSTALL} ${PORTNAME} # Console stuff - if [ -f ${PREFIX}/etc/bconsole.conf.new ]; then \ + if [ -f ${ETCDIR}/bconsole.conf.new ]; then \ ${ECHO_CMD} "etc/bconsole.conf.new" >> ${TMPPLIST}; \ - ${CHGRP} bacula ${PREFIX}/etc/bconsole.conf.new; \ - elif [ -f ${PREFIX}/etc/bconsole.conf ]; then \ - ${MV} ${PREFIX}/etc/bconsole.conf ${PREFIX}/etc/bconsole.conf.sample; \ - ${CHGRP} bacula ${PREFIX}/etc/bconsole.conf.sample; \ - ${ECHO_CMD} "etc/bconsole.conf.sample" >> ${TMPPLIST}; \ + ${CHGRP} bacula ${ETCDIR}/bconsole.conf.new; \ + elif [ -f ${ETCDIR}/bconsole.conf ]; then \ + ${MV} ${ETCDIR}/bconsole.conf ${ETCDIR}/bconsole.conf.sample; \ + ${CHGRP} bacula ${ETCDIR}/bconsole.conf.sample; \ + ${ECHO_CMD} "etc/bacula/bconsole.conf.sample" >> ${TMPPLIST}; \ fi # ensure that users in the bacula group can run bconsole @@ -226,22 +233,24 @@ post-install: .else # Install config files and preserve existing ones ${INSTALL_SCRIPT} ${FILESDIR}/chio-bacula ${PREFIX}/sbin - if [ -f ${PREFIX}/etc/bacula-barcodes ]; then \ - ${INSTALL_DATA} ${FILESDIR}/bacula-barcodes ${PREFIX}/etc/bacula-barcodes.new ; \ - ${ECHO_CMD} "etc/bacula-barcodes.new" >> ${TMPPLIST}; \ + if [ -f ${ETCDIR}/bacula-barcodes ]; then \ + ${INSTALL_DATA} ${FILESDIR}/bacula-barcodes ${ETCDIR}/bacula-barcodes.new ; \ + ${ECHO_CMD} "etc/bacula/bacula-barcodes.new" >> ${TMPPLIST}; \ else \ - ${INSTALL_DATA} ${FILESDIR}/bacula-barcodes ${PREFIX}/etc/bacula-barcodes.samples ; \ - ${ECHO_CMD} "etc/bacula-barcodes.samples" >> ${TMPPLIST}; \ + ${INSTALL_DATA} ${FILESDIR}/bacula-barcodes ${ETCDIR}/bacula-barcodes.samples ; \ + ${ECHO_CMD} "etc/bacula/bacula-barcodes.samples" >> ${TMPPLIST}; \ fi +# Add configuration files directory to packing list + ${ECHO_CMD} "@unexec rmdir %D/etc/bacula 2>/dev/null || true" >> ${TMPPLIST} # chmod of bsmtp program so bacula can use it with dropped down permissions ${CHMOD} o+x ${PREFIX}/sbin/bsmtp ${CHOWN} -R bacula:bacula ${PREFIX}/share/bacula # on a fresh install, the .new suffix is not used - if [ -f ${PREFIX}/etc/bacula-dir.conf.new ]; then \ - ${CHGRP} bacula ${PREFIX}/etc/bacula-dir.conf.new; \ + if [ -f ${ETCDIR}/bacula-dir.conf.new ]; then \ + ${CHGRP} bacula ${ETCDIR}/bacula-dir.conf.new; \ else \ - ${CHGRP} bacula ${PREFIX}/etc/bacula-dir.conf; \ + ${CHGRP} bacula ${ETCDIR}/bacula-dir.conf; \ fi ${CHGRP} bacula ${PREFIX}/sbin/dbcheck @@ -249,14 +258,17 @@ post-install: .endif # Install leaves existing conf files untouched. Respect this here! for na in ${CONFFILES}; do \ - if [ -f ${PREFIX}/etc/bacula-$$na.conf.new ]; then \ - ${ECHO_CMD} "etc/bacula-$$na.conf.new" >> ${TMPPLIST}; \ - elif [ -f ${PREFIX}/etc/bacula-$$na.conf ]; then \ - ${MV} ${PREFIX}/etc/bacula-$$na.conf ${PREFIX}/etc/bacula-$$na.conf.sample; \ - ${ECHO_CMD} "etc/bacula-$$na.conf.sample" >> ${TMPPLIST}; \ + if [ -f ${ETCDIR}/bacula-$$na.conf.new ]; then \ + ${ECHO_CMD} "etc/bacula/bacula-$$na.conf.new" >> ${TMPPLIST}; \ + elif [ -f ${ETCDIR}/bacula-$$na.conf ]; then \ + ${MV} ${ETCDIR}/bacula-$$na.conf ${ETCDIR}/bacula-$$na.conf.sample; \ + ${ECHO_CMD} "etc/bacula/bacula-$$na.conf.sample" >> ${TMPPLIST}; \ fi; \ done +# Add configuration files directory to packing list + ${ECHO_CMD} "@unexec rmdir %D/etc/bacula 2>/dev/null || true" >> ${TMPPLIST} + ${CHGRP} wheel ${PREFIX}/etc @${CAT} ${PKGMESSAGE} Modified: head/sysutils/bacula-server/Makefile.common ============================================================================== --- head/sysutils/bacula-server/Makefile.common Fri Jul 19 09:19:53 2013 (r323274) +++ head/sysutils/bacula-server/Makefile.common Fri Jul 19 09:44:58 2013 (r323275) @@ -48,7 +48,7 @@ pre-install: do-install: .if ${PKGNAMESUFFIX} == "-bat" # Install config files and preserve existing ones - ${INSTALL_SCRIPT} ${WRKSRC}/src/qt-console/bat.conf ${PREFIX}/etc/bat.conf.sample + ${INSTALL_SCRIPT} ${WRKSRC}/src/qt-console/bat.conf ${PREFIX}/etc/bacula/bat.conf.sample ${INSTALL_MAN} ${WRKSRC}/manpages/bat.1 ${PREFIX}/man/man1/ ${INSTALL_PROGRAM} ${WRKSRC}/src/qt-console/bat ${PREFIX}/sbin .endif Modified: head/sysutils/bacula-server/files/bacula-dir.in ============================================================================== --- head/sysutils/bacula-server/files/bacula-dir.in Fri Jul 19 09:19:53 2013 (r323274) +++ head/sysutils/bacula-server/files/bacula-dir.in Fri Jul 19 09:44:58 2013 (r323275) @@ -23,7 +23,7 @@ command=%%PREFIX%%/sbin/bacula-dir load_rc_config $name : ${bacula_dir_enable="NO"} -: ${bacula_dir_flags=" -u bacula -g bacula -v -c %%PREFIX%%/etc/bacula-dir.conf"} +: ${bacula_dir_flags=" -u bacula -g bacula -v -c %%PREFIX%%/etc/bacula/bacula-dir.conf"} : ${bacula_dir_pidfile="/var/run/bacula-dir.9101.pid"} pidfile="${bacula_dir_pidfile}" Modified: head/sysutils/bacula-server/files/bacula-fd.in ============================================================================== --- head/sysutils/bacula-server/files/bacula-fd.in Fri Jul 19 09:19:53 2013 (r323274) +++ head/sysutils/bacula-server/files/bacula-fd.in Fri Jul 19 09:44:58 2013 (r323275) @@ -23,7 +23,7 @@ command=%%PREFIX%%/sbin/bacula-fd load_rc_config $name : ${bacula_fd_enable="NO"} -: ${bacula_fd_flags=" -u root -g wheel -v -c %%PREFIX%%/etc/bacula-fd.conf"} +: ${bacula_fd_flags=" -u root -g wheel -v -c %%PREFIX%%/etc/bacula/bacula-fd.conf"} : ${bacula_fd_pidfile="/var/run/bacula-fd.9102.pid"} pidfile="${bacula_fd_pidfile}" Modified: head/sysutils/bacula-server/files/bacula-sd.in ============================================================================== --- head/sysutils/bacula-server/files/bacula-sd.in Fri Jul 19 09:19:53 2013 (r323274) +++ head/sysutils/bacula-server/files/bacula-sd.in Fri Jul 19 09:44:58 2013 (r323275) @@ -23,7 +23,7 @@ command=%%PREFIX%%/sbin/bacula-sd load_rc_config $name : ${bacula_sd_enable="NO"} -: ${bacula_sd_flags=" -u bacula -g bacula -v -c %%PREFIX%%/etc/bacula-sd.conf"} +: ${bacula_sd_flags=" -u bacula -g bacula -v -c %%PREFIX%%/etc/bacula/bacula-sd.conf"} : ${bacula_sd_pidfile="/var/run/bacula-sd.9103.pid"} pidfile="${bacula_sd_pidfile}" Modified: head/sysutils/bacula-server/files/chio-bacula ============================================================================== --- head/sysutils/bacula-server/files/chio-bacula Fri Jul 19 09:19:53 2013 (r323274) +++ head/sysutils/bacula-server/files/chio-bacula Fri Jul 19 09:44:58 2013 (r323275) @@ -39,7 +39,7 @@ logger -p user.err "$me $@" # This simulates a barcode reader in the changer. # The labes of the virtual barcode reader are located in the BARCODE_FILE SIMULATE_BARCODE=true -BARCODE_FILE=/usr/local/etc/bacula-barcodes +BARCODE_FILE=/usr/local/etc/bacula/bacula-barcodes MTX=/bin/chio # Set default values (see case statement below for # free mapping of drive index and tape device Modified: head/sysutils/bacula-server/files/pkg-message.client.in ============================================================================== --- head/sysutils/bacula-server/files/pkg-message.client.in Fri Jul 19 09:19:53 2013 (r323274) +++ head/sysutils/bacula-server/files/pkg-message.client.in Fri Jul 19 09:44:58 2013 (r323275) @@ -1,7 +1,7 @@ ################################################################################ NOTE: -Sample files are installed in %%PREFIX%%/etc: +Sample files are installed in %%PREFIX%%/etc/bacula: bconsole.conf.sample, bacula-barcodes.sample, bacula-fd.conf.sample Please read this file: Modified: head/sysutils/bacula-server/files/pkg-message.server.in ============================================================================== --- head/sysutils/bacula-server/files/pkg-message.server.in Fri Jul 19 09:19:53 2013 (r323274) +++ head/sysutils/bacula-server/files/pkg-message.server.in Fri Jul 19 09:44:58 2013 (r323275) @@ -17,7 +17,7 @@ chio command is included and installed a Please have a look at it if you want to use an autochanger. You have to configure the usage in - %%PREFIX%%/etc/bacula-dir.conf + %%PREFIX%%/etc/bacula/bacula-dir.conf Take care of correct permissions for changer and tape device (e.g. /dev/ch0 and /dev/n[r]sa0) i.e. _______________________________________________ svn-ports-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-ports-all To unsubscribe, send any mail to "svn-ports-all-unsubscribe@freebsd.org" State Changed From-To: feedback->closed Committed, thank you! |