From 0813ec725e6e3820159237dfcc9a848383f865aa Mon Sep 17 00:00:00 2001 From: Russ Allbery Date: Sat, 25 Sep 2010 16:42:57 -0700 Subject: [PATCH] Update Debian packaging to 1.5.77-2 release Contains DKMS robustness fixes, improvements to the defaults for the module build, and cleanup of the openafs-client init script. Updates the build system for the new demand-attach binary naming and for the changes to supported configure options. Fixes some issues with afs-newcell. Forces disabling of the Linux syscall probing in kernel module builds, since no supported Debian kernel allows this and it causes problems. Update debhelper to V8, which allows simplification of debian/rules and debian/module/rules. Reviewed-on: http://gerrit.openafs.org/2849 Reviewed-by: Derrick Brashear Tested-by: Derrick Brashear (cherry picked from commit 7d272f05059a4b467ee41a2a0d8781e9f9c4c250) Change-Id: Ic0468c79db043651889b2a9b2e18b0246acf7c71 Reviewed-on: http://gerrit.openafs.org/2924 --- src/packaging/Debian/README.servers | 13 ++- src/packaging/Debian/afs-newcell | 8 +- src/packaging/Debian/changelog.in | 81 +++++++++++++++- src/packaging/Debian/compat | 2 +- src/packaging/Debian/control | 10 +- src/packaging/Debian/module/compat | 2 +- src/packaging/Debian/module/control | 4 +- src/packaging/Debian/module/control.in | 4 +- src/packaging/Debian/module/rules | 97 ++++++------------- src/packaging/Debian/openafs-client.init | 37 +------ src/packaging/Debian/openafs-fileserver.NEWS | 37 ++++--- .../Debian/openafs-fileserver.config | 2 +- src/packaging/Debian/openafs-fileserver.init | 31 +++++- .../Debian/openafs-fileserver.install | 6 ++ .../Debian/openafs-modules-dkms.dkms | 12 +-- src/packaging/Debian/rules | 86 ++++++++-------- 16 files changed, 242 insertions(+), 190 deletions(-) diff --git a/src/packaging/Debian/README.servers b/src/packaging/Debian/README.servers index d92a2ae7a..75a54458a 100644 --- a/src/packaging/Debian/README.servers +++ b/src/packaging/Debian/README.servers @@ -6,7 +6,7 @@ Introduction packages. If you are not already familiar with the basic concepts of OpenAFS, you should review the documentation at: - + http://docs.openafs.org/ particularly the AFS Administrator's Guide. This documentation is somewhat out of date (it doesn't talk about how to use a Kerberos v5 KDC @@ -313,8 +313,9 @@ Adding Additional Servers 3. If the machine is to be a file server, create an fs instance using bos create: - bos create fs fs -cmd /usr/lib/openafs/fileserver \ - -cmd /usr/lib/openafs/volserver \ + bos create fs fs -cmd /usr/lib/openafs/dafileserver \ + -cmd /usr/lib/openafs/davolserver \ + -cmd /usr/lib/openafs/salvageserver \ -cmd /usr/lib/openafs/salvager -localauth For a file server, this is all you have to do. The above uses the @@ -326,9 +327,13 @@ Adding Additional Servers -b 240 -vc 1200 If you want to add any additional fileserver options, enclose - /usr/lib/openafs/fileserver and the following options in double + /usr/lib/openafs/dafileserver and the following options in double quotes when giving the bos create command. + This creates a demand-attach fileserver, which is recommended for + new installations. You can also create a regular fileserver if you + prefer. See the bos_create(8) man page for more information. + 4. For database servers, also install openafs-dbserver and then use bos addhost to add the new server to /etc/openafs/server/CellServDB: diff --git a/src/packaging/Debian/afs-newcell b/src/packaging/Debian/afs-newcell index 218dd250a..97727e5a6 100755 --- a/src/packaging/Debian/afs-newcell +++ b/src/packaging/Debian/afs-newcell @@ -175,7 +175,7 @@ unless ($found) { print "The new cell $cell is not configured in /etc/openafs/CellServDB\n"; print "Add configuration like:\n\n"; print ">$cell\n"; - print inet_ntoa($ip), "\n\n"; + print inet_ntoa($ip), "\t\t\t#$server\n\n"; print "to that file before continuing.\n"; exit(1); } @@ -229,10 +229,10 @@ unwind("bos delete $server vlserver -localauth"); # Create a file server as well. run("bos create $server dafs dafs" - . " -cmd '/usr/lib/openafs/fileserver $fs_options'" - . " -cmd /usr/lib/openafs/volserver" + . " -cmd '/usr/lib/openafs/dafileserver $fs_options'" + . " -cmd /usr/lib/openafs/davolserver" . " -cmd /usr/lib/openafs/salvageserver" - . " -cmd /usr/lib/openafs/salvager"); + . " -cmd /usr/lib/openafs/dasalvager"); unwind("bos delete $server fs -localauth"); # Make sure that there is no scheduled general restart time; it's not needed. diff --git a/src/packaging/Debian/changelog.in b/src/packaging/Debian/changelog.in index 7644edb0e..273c3fb70 100644 --- a/src/packaging/Debian/changelog.in +++ b/src/packaging/Debian/changelog.in @@ -12,6 +12,85 @@ openafs (@DEB_PKGVER@-1~openafs) unstable; urgency=low -- Russ Allbery Thu, 08 Apr 2010 13:20:50 -0700 +openafs (1.5.77-2) experimental; urgency=low + + * Apply upstream deltas: + - [ca2a7363] libuafs: Don't #define user (fixes armel build) + - [f7f366d0] Link dafssync-debug(8) to fssync-debug(8) + - [a2cf6b8d] Fix POD errors in fileserver and dasalvager + - [e36b4e00] Update bos create man page for new demand-attach + * Add backslashes to the DKMS command, which will be required once DKMS + uses proper shell quoting. + * In openafs-modules-source, use /lib/modules/`uname -r`/build as the + default path to the kernel headers rather than /usr/src/linux. + Current kernel header packages will create an appropriate symlink + there. This default is only used when neither module-assistant nor + kernel-package are used. + * In the openafs-client init script, stop looking for openafs.o; Debian + hasn't supported 2.4 kernels for quite some time. Remove all the $MP + handling since we force a module name of openafs.ko using + --with-linux-kernel-packaging. + + -- Russ Allbery Fri, 24 Sep 2010 21:37:03 -0700 + +openafs (1.5.77-1) experimental; urgency=low + + * Apply upstream deltas: + - [7594331c] Add NEWS entries for OpenAFS 1.5.77 and 1.5.76 + * New upstream testing release. + - Demand-attach servers are now always built and installed under + separate names (dafileserver, davolserver, dasalvager). This means + that the default names are no longer demand-attach, which means that + upgrades from previous experimental versions will fail (but upgrades + from non-experimental versions will be much cleaner). + - Linux 2.6.36 support and improved freezer interface support. + - More robust path MTU detection. + - Return VNOVOL from fileserver when a volume is deleted. + - Improve handling of some corruption in the salvager. + - Relax too-strict checks in ptserver on foreign names. + - Better reporting of failures during volume attach. + - Better fileserver handling of host hash collisions. + - Fix statistics reporting in RXAFS_GetStatistics64. + - Improved disconnected mode reference tracking. + - Avoid a kernel panic during vcache contention. + - Fix potential kernel panic during bulkstatus. + - Better vos dry-run mode for syncvldb and syncserv. + - Fix s390x kernel build support. + * Update afs-newcell and README.servers to recommend using the + demand-attach fileserver binaries and dafs bos type. + * Force disabling of Linux syscall probing in kernel module builds. + * Remove obsolete --enable-demand-attach-fs and --enable-disconnected + configure flags. These are now unconditional upstream. + * The openafs-fileserver init script now depends on $named since + apparently the volserver requires DNS during startup. Thanks, Jaap + Winius. (Closes: #589783) + * Use dpkg --print-architecture, not --print-installation-architecture, + in the openafs-fileserver config script. The latter is deprecated. + Thanks, Peter Palfrader. (Closes: #594488) + * Add a dependency on libc6-dev to openafs-modules-dkms. dkms doesn't + depend on it because most kernel modules don't need it, but openafs + builds userspace helper programs. Thanks, Peter Palfrader. + * Fix the sample CellServDB entry printed by afs-newcell if the cell + isn't found in /etc/openafs/CellServDB to include the correct server + syntax. Thanks, Peter Palfrader. + * Run the DKMS build commands in a subshell to work around a DKMS bug + that caused the module build logs to be discarded. (LP: #593509) + * Add a status command to the openafs-fileserver init script. + * Update to debhelper compatibility level V8. + - Rewrite debian/rules to use dh and overrides. + - Use dh_installdocs --link-doc to handle linked doc directories. + - Rewrite debian/module/rules to use dh and overrides. + - Bump -source package dependency and compat to debhelper 8. + * Add ${perl:Depends} to openafs-modules-dkms and perl to the + dependencies of openafs-modules-source, since Perl is used as part of + the module build system now. + * Remove bison and flex dependencies for the module build packages. We + now ship the results of rxgen, so don't need all the tools required to + build the full source tree. + * Update standards version to 3.9.1 (no changes required). + + -- Russ Allbery Tue, 21 Sep 2010 17:59:42 -0700 + openafs (1.5.75-2) experimental; urgency=low * Apply upstream deltas: @@ -111,7 +190,7 @@ openafs (1.5.74.1-1) experimental; urgency=low and invalidate the old cache. - Resolve symlinks in fs rmmount. - Include PID in byte-range lock warning. - * Preserve the AFS mount point and cache directorys set in + * Preserve the AFS mount point and cache directories set in /etc/openafs/cacheinfo if the file already exists rather than overwriting them with the defaults. Thanks, Liam Healy. (Closes: #580077) diff --git a/src/packaging/Debian/compat b/src/packaging/Debian/compat index 7f8f011eb..45a4fb75d 100644 --- a/src/packaging/Debian/compat +++ b/src/packaging/Debian/compat @@ -1 +1 @@ -7 +8 diff --git a/src/packaging/Debian/control b/src/packaging/Debian/control index 31c5c5a95..4019d8599 100644 --- a/src/packaging/Debian/control +++ b/src/packaging/Debian/control @@ -3,11 +3,11 @@ Section: net Priority: optional Maintainer: Russ Allbery Uploaders: Sam Hartman -Build-Depends: debhelper (>= 7), autoconf, automake, bison, comerr-dev, +Build-Depends: debhelper (>= 8), autoconf, automake, bison, comerr-dev, cpio, dblatex, dkms (>= 2.1.1.1), docbook-xsl, doxygen, flex, libfuse-dev, libkrb5-dev, libncurses5-dev, libpam0g-dev, libxml2-utils, perl, pkg-config, xsltproc -Standards-Version: 3.9.0 +Standards-Version: 3.9.1 Homepage: http://www.openafs.org/ Vcs-Git: git://git.debian.org/git/pkg-k5-afs/openafs.git Vcs-Browser: http://git.debian.org/?p=pkg-k5-afs/openafs.git @@ -173,8 +173,8 @@ Package: openafs-modules-source Section: kernel Priority: extra Architecture: all -Depends: ${misc:Depends}, bison, flex, debhelper (>= 5), - module-assistant | kernel-package +Depends: ${misc:Depends}, debhelper (>= 8), + module-assistant | kernel-package, perl Recommends: openafs-client (>= ${source:Version}) Description: AFS distributed filesystem kernel module source AFS is a distributed filesystem allowing cross-platform sharing of @@ -188,7 +188,7 @@ Package: openafs-modules-dkms Section: kernel Priority: extra Architecture: all -Depends: ${misc:Depends}, dkms, bison, flex +Depends: ${misc:Depends}, ${perl:Depends}, dkms, libc6-dev Recommends: openafs-client (>= ${source:Version}) Description: AFS distributed filesystem kernel module DKMS source AFS is a distributed filesystem allowing cross-platform sharing of diff --git a/src/packaging/Debian/module/compat b/src/packaging/Debian/module/compat index 7ed6ff82d..45a4fb75d 100644 --- a/src/packaging/Debian/module/compat +++ b/src/packaging/Debian/module/compat @@ -1 +1 @@ -5 +8 diff --git a/src/packaging/Debian/module/control b/src/packaging/Debian/module/control index 85e422300..65708c4e1 100644 --- a/src/packaging/Debian/module/control +++ b/src/packaging/Debian/module/control @@ -3,6 +3,6 @@ Section: kernel Priority: optional Maintainer: Russ Allbery Uploaders: Sam Hartman -Build-Depends: debhelper (>= 5), flex, bison -Standards-Version: 3.9.0 +Build-Depends: debhelper (>= 8) +Standards-Version: 3.9.1 Homepage: http://www.openafs.org/ diff --git a/src/packaging/Debian/module/control.in b/src/packaging/Debian/module/control.in index 69e7e882a..13355cdb7 100644 --- a/src/packaging/Debian/module/control.in +++ b/src/packaging/Debian/module/control.in @@ -3,8 +3,8 @@ Section: kernel Priority: optional Maintainer: Russ Allbery Uploaders: Sam Hartman -Build-Depends: debhelper (>= 5), flex, bison -Standards-Version: 3.9.0 +Build-Depends: debhelper (>= 8) +Standards-Version: 3.9.1 Package: openafs-modules-=KVERS Breaks: openafs-client (<< 1.5.61) diff --git a/src/packaging/Debian/module/rules b/src/packaging/Debian/module/rules index 9b48eff56..6cfc96269 100755 --- a/src/packaging/Debian/module/rules +++ b/src/packaging/Debian/module/rules @@ -1,23 +1,4 @@ #!/usr/bin/make -f -# Based on sample debian/rules that uses debhelper. -# GNU copyright 1997 by Joey Hess. -# -# The rules file for the OpenAFS module build. - -# Uncomment this to turn on verbose mode. -#export DH_VERBOSE=1 - -# This has to be exported to make some magic below work. -export DH_OPTIONS - -# Tell Autoconf the correct system types. -DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) -DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE) -ifeq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE)) - SYSTEM = --build $(DEB_HOST_GNU_TYPE) -else - SYSTEM = --build $(DEB_BUILD_GNU_TYPE) --host $(DEB_HOST_GNU_TYPE) -endif # Determine whether we're building with optimization. This doesn't really # work at the moment due to upstream problems. @@ -31,7 +12,7 @@ endif # Find kernel build information. ifndef KSRC - KSRC = /usr/src/linux + KSRC := /lib/modules/$(shell uname -r)/build endif ifndef KPKG_DEST_DIR KPKG_DEST_DIR = .. @@ -48,74 +29,55 @@ package = openafs modulepkg := openafs-modules-$(KVERS)${INT_SUBARCH} moduledir := debian/$(modulepkg)/lib/modules/$(KVERS)/fs -configure: configure-modules-stamp -configure-stamp: +# This setup must be done before running any other target if it hasn't +# already been done. +setup: @if test x"$(SYS_NAME)" = x"UNKNOWN" ; then exit 1 ; fi @if test x"$(KVERS)" = x ; then \ echo 'No version in $(KSRC)/include/linux/version.h' >&2 ; \ exit 1 ; \ fi sh debian/prep-modules $(KSRC) - sh configure --with-afs-sysname=$(SYS_NAME) \ - --with-linux-kernel-headers=$(KSRC) --prefix=`pwd`/debian/tmp \ - --with-linux-kernel-packaging --enable-disconnected \ - --enable-debug --enable-debug-lwp --enable-debug-kernel \ - $(DEBIAN_OPT_FLAGS) $(DEBIAN_KERN_FLAGS) touch $@ -build: build-arch build-indep -build-arch: build-stamp -build-indep: -build-stamp: configure-stamp - $(MAKE) - touch $@ +%: setup + dh $@ -clean: - dh_testdir - dh_testroot - rm -rf src/libafs/MODLOAD-* *-stamp - dh_clean Makefile config.log config.status src/libafs/Makefile \ - src/libafs/Makefile.common src/libafs/asm src/libafs/asm-generic \ - src/libafs/h src/libafs/linux src/libafs/net src/libafs/netinet \ - src/libafs/rpc src/libafs/sys +override_dh_auto_configure: + sh configure --prefix=$(CURDIR)/debian/tmp \ + --with-afs-sysname=$(SYS_NAME) \ + --disable-linux-syscall-probing \ + --with-linux-kernel-headers=$(KSRC) \ + --with-linux-kernel-packaging \ + --enable-debug --enable-debug-lwp --enable-debug-kernel \ + $(DEBIAN_OPT_FLAGS) $(DEBIAN_KERN_FLAGS) -install: install-stamp -install-stamp: build-stamp - dh_testdir - dh_testroot - dh_clean -k +override_dh_auto_install: cd src/libafs && make install DESTDIR=$(CURDIR)/debian/tmp install -d -g root -o root -m 755 $(moduledir) install -g root -o root -m 644 \ debian/tmp/lib/modules/*/extra/openafs/*o $(moduledir)/ - touch $@ -binary: binary-arch binary-indep -binary-indep: -binary-arch: install-stamp - dh_testdir - dh_testroot - dh_installchangelogs - dh_installdocs - dh_installmodules - dh_strip - dh_link - dh_compress - dh_fixperms - dh_installdeb +override_dh_clean: + rm -rf src/libafs/MODLOAD-* *-stamp + dh_clean Makefile config.log config.status setup src/libafs/Makefile \ + src/libafs/Makefile.common src/libafs/asm src/libafs/asm-generic \ + src/libafs/h src/libafs/linux src/libafs/net src/libafs/netinet \ + src/libafs/rpc src/libafs/sys + +override_dh_gencontrol: dh_gencontrol -- -v`cat debian/VERSION` - dh_md5sums - dh_builddeb --destdir="$(KPKG_DEST_DIR)" -#################### Module package support (make-kpkg) #################### +override_dh_builddeb: + dh_builddeb --destdir="$(KPKG_DEST_DIR)" -kdist_configure: configure-stamp +kdist_configure: override_dh_auto_configure -kdist_image: build-stamp +kdist_image: $(ROOT_CMD) $(MAKE) $(MFLAGS) -f debian/rules binary-arch $(ROOT_CMD) $(MAKE) $(MFLAGS) -f debian/rules clean -kdist: build-stamp +kdist: $(ROOT_CMD) $(MAKE) $(MFLAGS) -f debian/rules binary-arch KSRC="$(KSRC)" KMAINT="$(KMAINT)" KEMAIL="$(KEMAIL)" \ sh -v debian/genchanges @@ -124,5 +86,4 @@ kdist: build-stamp kdist_clean: $(ROOT_CMD) $(MAKE) $(MFLAGS) -f debian/rules clean -.PHONY: binary binary-arch binary-indep build build-arch build-indep clean -.PHONY: configure install kdist kdist_clean kdist_configure kdist_image +.PHONY: kdist kdist_clean kdist_configure kdist_image diff --git a/src/packaging/Debian/openafs-client.init b/src/packaging/Debian/openafs-client.init index 02de249b5..94360e640 100755 --- a/src/packaging/Debian/openafs-client.init +++ b/src/packaging/Debian/openafs-client.init @@ -49,48 +49,13 @@ is_on() { fi } -# If choose_client can't correctly determine which client to use, set -# LIBAFS manually. -choose_client() { - # Use the second field of the uname -v output instead of just doing a - # match on the whole thing to protect against matching a timezone named - # SMP -- I don't know of one, but let's be paranoid. - set X `uname -v`; shift - case $2 in - SMP) MP=.mp ;; # MP system - *) MP= ;; # SP system - esac - - # The Debian OpenAFS packages do not add the .mp by default as of 1.3, but - # modules obtained from other sources may. If a module with the .mp - # exists and this is an SMP system, use it; otherwise, use the default - # value. Unset $MP if not using it so that we can use it later in the - # call to modprobe. - # - # Assume that if we're using DKMS, we won't have a .mp and we'll always - # have a *.ko module name. - if [ -f "$DKMSDIR/openafs.ko" ] ; then - LIBAFS=openafs.ko - elif [ -n "$MP" -a -f "$MODULEDIR/openafs${MP}.o" ] ; then - LIBAFS=openafs${MP}.o - elif [ -n "$MP" -a -f "$MODULEDIR/openafs${MP}.ko" ] ; then - LIBAFS=openafs${MP}.ko - elif [ -f "$MODULEDIR/openafs.ko" ] ; then - MP= - LIBAFS=openafs.ko - else - MP= - LIBAFS=openafs.o - fi -} - # Load the AFS client module if it's not already loaded. Set $MODULEDIR and # $LIBAFS to override the default location and module name. Also check before # loading whether the module is listed in the module dependencies so that we # can exit with a 0 status in that case. load_client() { if [ -z "$LIBAFS" ] ; then - choose_client + LIBAFS=openafs.ko fi if [ ! -f "$MODULEDIR/$LIBAFS" -a ! -f "$DKMSDIR/$LIBAFS" ] ; then echo "" diff --git a/src/packaging/Debian/openafs-fileserver.NEWS b/src/packaging/Debian/openafs-fileserver.NEWS index f5feb8c1c..a6025b555 100644 --- a/src/packaging/Debian/openafs-fileserver.NEWS +++ b/src/packaging/Debian/openafs-fileserver.NEWS @@ -1,6 +1,8 @@ -openafs (1.5.73.3-1) experimental; urgency=low +openafs (1.5.77-1) experimental; urgency=low + + This version of the OpenAFS file server includes a version built with + demand-attach, but as binaries with a different name. - This version of the OpenAFS file server is built with demand-attach. Demand-attach completely changes how the file server shuts down and starts up. Instead of detaching all volumes on shutdown and reattaching them on startup, the file server saves state to disk and restores state @@ -8,12 +10,10 @@ openafs (1.5.73.3-1) experimental; urgency=low attached when used and are detached again if they go unused for an extended period. Volumes can also be salvaged on demand. - Demand-attach is experimental. Please only use this file server for - testing. It is not yet ready to run in a production environment. - - This change REQUIRES changes to your BosConfig file so that the file - server will start properly. After installing the new openafs-fileserver - package, run: + Demand-attach is recommended for new deployments and for evaluation in + current production deployments, but requires a change to your bos + configuration to use. If you want to switch your file server to + demand-attach, run: bos status localhost -instance fs -long @@ -23,12 +23,27 @@ openafs (1.5.73.3-1) experimental; urgency=low bos stop localhost fs -localauth bos delete localhost fs -localauth bos create localhost dafs dafs \ - "/usr/lib/openafs/fileserver " \ - "/usr/lib/openafs/volserver " \ - /usr/lib/openafs/salvageserver /usr/lib/openafs/salvager + "/usr/lib/openafs/dafileserver " \ + "/usr/lib/openafs/davolserver " \ + /usr/lib/openafs/salvageserver /usr/lib/openafs/dasalvager to create the correct new BosConfig entry for demand-attach AFS. + If you were running an earlier version of the experimental + openafs-filserver package, the way that demand-attach was handled has + changed and you have to change your bos configuration to use the new + demand-attach binary names. Run: + + bos stop localhost dafs -localauth + bos delete localhost dafs -localauth + + and then run the bos create command above. This only applies to users + of the previous experimental packages, not to upgrades from unstable. + + -- Russ Allbery Tue, 21 Sep 2010 14:08:04 -0700 + +openafs (1.5.73.3-1) experimental; urgency=low + As of this release, the default permissions for /etc/openafs/server are now 0755, matching upstream. The only file in that directory that needs to be kept secure is KeyFile, which is created with 0600 permissions. diff --git a/src/packaging/Debian/openafs-fileserver.config b/src/packaging/Debian/openafs-fileserver.config index c333f4784..9e221e616 100644 --- a/src/packaging/Debian/openafs-fileserver.config +++ b/src/packaging/Debian/openafs-fileserver.config @@ -6,7 +6,7 @@ set -e db_version 2.0 # Warn anyone who's trying to run the file server on alpha. -arch=`dpkg --print-installation-architecture` +arch=`dpkg --print-architecture` if [ "$arch" = "alpha" ] ; then db_input high openafs-fileserver/alpha-broken || true fi diff --git a/src/packaging/Debian/openafs-fileserver.init b/src/packaging/Debian/openafs-fileserver.init index 5db046378..ea1b41fe8 100755 --- a/src/packaging/Debian/openafs-fileserver.init +++ b/src/packaging/Debian/openafs-fileserver.init @@ -1,8 +1,8 @@ #! /bin/sh ### BEGIN INIT INFO # Provides: openafs-fileserver -# Required-Start: $local_fs $remote_fs $network $time -# Required-Stop: $local_fs $remote_fs $network +# Required-Start: $remote_fs $network $time $named +# Required-Stop: $remote_fs $network # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Short-Description: OpenAFS file and database server manager @@ -25,8 +25,10 @@ DAEMON=/usr/sbin/bosserver DAEMON_ARGS="" SCRIPTNAME=/etc/init.d/openafs-fileserver -# Exit if the package is not installed. -[ -x "$DAEMON" ] || exit 0 +# Exit if the package is not installed and we were not given the status option. +if [ ! -x "$DAEMON" ] && [ "status" != "$1" ] ; then + exit 0 +fi # Read configuration if it is present. [ -r /etc/default/openafs-fileserver ] && . /etc/default/openafs-fileserver @@ -109,8 +111,27 @@ case "$1" in esac ;; + status) + start-stop-daemon --start --quiet --startas $DAEMON --name $NAME --test \ + > /dev/null + case "$?" in + 0) + echo "$NAME is not running" + exit 3 + ;; + 1) + echo "$NAME is running" + exit 0 + ;; + *) + log_warning_msg "Cannot determine if $NAME is running" + exit 4 + ;; + esac + ;; + *) - echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload}" >&2 + echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload|status}" >&2 exit 3 ;; esac diff --git a/src/packaging/Debian/openafs-fileserver.install b/src/packaging/Debian/openafs-fileserver.install index 351ba0ff8..97fc481fa 100644 --- a/src/packaging/Debian/openafs-fileserver.install +++ b/src/packaging/Debian/openafs-fileserver.install @@ -1,5 +1,6 @@ debian/tmp/usr/sbin/bos_util usr/sbin debian/tmp/usr/sbin/bosserver usr/sbin +debian/tmp/usr/sbin/dafssync-debug usr/sbin debian/tmp/usr/sbin/fssync-debug usr/sbin debian/tmp/usr/sbin/salvsync-debug usr/sbin debian/tmp/usr/sbin/state_analyzer usr/sbin @@ -28,11 +29,16 @@ debian/tmp/usr/share/man/man5/UserList.5 usr/share/man/man5 debian/tmp/usr/share/man/man5/VolserLog.5 usr/share/man/man5 debian/tmp/usr/share/man/man5/afs_volume_header.5 usr/share/man/man5 debian/tmp/usr/share/man/man5/krb.conf.5 usr/share/man/man5 +debian/tmp/usr/share/man/man5/krb.excl.5 usr/share/man/man5 debian/tmp/usr/share/man/man5/salvage.lock.5 usr/share/man/man5 debian/tmp/usr/share/man/man5/sysid.5 usr/share/man/man5 debian/tmp/usr/share/man/man8/bos_util.8 usr/share/man/man8 debian/tmp/usr/share/man/man8/bosserver.8 usr/share/man/man8 +debian/tmp/usr/share/man/man8/dafileserver.8 usr/share/man/man8 +debian/tmp/usr/share/man/man8/dafssync-debug.8 usr/share/man/man8 +debian/tmp/usr/share/man/man8/dasalvager.8 usr/share/man/man8 +debian/tmp/usr/share/man/man8/davolserver.8 usr/share/man/man8 debian/tmp/usr/share/man/man8/fileserver.8 usr/share/man/man8 debian/tmp/usr/share/man/man8/fssync-debug.8 usr/share/man/man8 debian/tmp/usr/share/man/man8/fssync-debug_attach.8 usr/share/man/man8 diff --git a/src/packaging/Debian/openafs-modules-dkms.dkms b/src/packaging/Debian/openafs-modules-dkms.dkms index 607151627..e99876e6f 100644 --- a/src/packaging/Debian/openafs-modules-dkms.dkms +++ b/src/packaging/Debian/openafs-modules-dkms.dkms @@ -8,9 +8,9 @@ BUILT_MODULE_NAME[0]="$PACKAGE_NAME" DEST_MODULE_LOCATION[0]="/updates/dkms/" AUTOINSTALL=yes -MAKE[0]="./configure --enable-disconnected \ - --with-linux-kernel-headers=${kernel_source_dir} \ - --with-linux-kernel-packaging - && make - && mv src/libafs/MODLOAD-*/openafs.ko ." -CLEAN="rm -f openafs.ko && make -C src/libafs clean" +MAKE[0]="(./configure --disable-linux-syscall-probing \ + --with-linux-kernel-packaging \ + --with-linux-kernel-headers=${kernel_source_dir} \ + && make \ + && mv src/libafs/MODLOAD-*/openafs.ko .)" +CLEAN="rm -f openafs.ko && make clean" diff --git a/src/packaging/Debian/rules b/src/packaging/Debian/rules index e10f0fbfc..9b8587688 100755 --- a/src/packaging/Debian/rules +++ b/src/packaging/Debian/rules @@ -1,9 +1,4 @@ #!/usr/bin/make -f -# Based on the sample debian/rules that uses debhelper. -# GNU copyright 1997 by Joey Hess. - -# Uncomment this to turn on verbose mode. -#export DH_VERBOSE=1 # Tell Autoconf the correct system types. DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) @@ -38,9 +33,10 @@ HTML_XSL = /usr/share/xml/docbook/stylesheet/nwalsh/html/chunk.xsl # The /usr/share/doc directory for these packages should be a symlink to # /usr/share/doc/openafs-client. Any package on this list must depend on -# openafs-client. -DOC_PACKAGES = libpam-openafs-kaserver openafs-dbserver openafs-fuse \ - openafs-kpasswd +# openafs-client. This variable is used as options to dh_installdocs with +# the --link-doc option. +DOC_PACKAGES = -plibpam-openafs-kaserver -popenafs-dbserver -popenafs-fuse \ + -popenafs-kpasswd # These are files that we know we don't want to install. List them so that we # can use dh_install --fail-missing and catch anything new that shows up. @@ -81,14 +77,14 @@ get-orig-source: rm -r openafs_$(DEBVERS).orig gzip -9 openafs_$(DEBVERS).orig.tar +# Use dh for most actions, with overrides below. +%: + dh $@ + # Handle the renaming of the up man page to afs-up here since the man pages # are generated from POD source by regen.sh. -build: build-arch build-indep -build-arch: build-stamp -build-indep: -build-stamp: +override_dh_auto_configure: @if test x"$(SYS_NAME)" = x"UNKNOWN" ; then exit 1 ; fi - dh build --before configure echo '$(DEBIAN)'-debian > .version mv doc/man-pages/pod1/up.pod doc/man-pages/pod1/afs-up.pod rm -f doc/man-pages/man1/up.1 @@ -99,23 +95,23 @@ build-stamp: --prefix=/usr --mandir=\$${prefix}/share/man \ --sysconfdir=/etc --libexecdir=/usr/lib --with-krb5 \ --localstatedir=/var/lib --enable-supergroups \ - --enable-demand-attach-fs --enable-disconnected \ --enable-fuse-client --enable-debug --enable-debug-lwp \ --with-xslt-processor=xsltproc --with-html-xsl=$(HTML_XSL) \ --enable-reduced-depends $(DEBIAN_OPT_FLAGS) $(SYSTEM) - chmod a+x config.sub - dh build --after configure + +# Also build a libafs_tree and build the XML documentation. +override_dh_auto_build: + dh_auto_build $(MAKE) libafs_tree set -e; for d in AdminGuide QuickStartUnix UserGuide ; do \ $(MAKE) -C doc/xml/$$d all ; \ done - touch $@ # The manipulation of debian/changelog here is unnecessary with a regular # Debian build. It is provided solely so that upstream can share the Debian # packaging files, working around problems caused by upstream's distclean # removing packaging/Debian/changelog because it's Autoconf-generated. -clean: +override_dh_auto_clean: [ ! -f doc/man-pages/pod1/afs-up.pod ] \ || mv doc/man-pages/pod1/afs-up.pod doc/man-pages/pod1/up.pod set -e; for d in AdminGuide QuickStartUnix UserGuide ; do \ @@ -123,21 +119,25 @@ clean: done [ ! -f debian/changelog.in ] \ || cp debian/changelog debian/changelog.save - dh clean + dh_auto_clean [ -f debian/changelog ] || mv debian/changelog.save debian/changelog -install: install-stamp -install-stamp: build-stamp - dh install --until dh_prep +# We have to use a non-standard install target and then do some fiddling +# with the results. +override_dh_auto_install: mkdir -p $(CURDIR)/debian/tmp $(MAKE) install_nolibafs DESTDIR=$(CURDIR)/debian/tmp rm -f debian/tmp/usr/bin/klog.krb rm -f debian/tmp/usr/share/man/man1/klog.krb.1 + +# Override dh_install to handle installation of all the extra documentation +# that upstream doesn't install by default, install the source required for +# the kernel source package and the DKMS package, move some files about and +# do some manually installation of additional things like PAM modules, and +# to ensure that the extra scripts we install are executable. +override_dh_install: chmod +x debian/afs-rootvol debian/afs-newcell - dh_installdirs dh_install --fail-missing $(IGNORE) - dh_installinit -popenafs-client -r -- defaults 25 20 - dh_installinit -popenafs-fileserver -r mkdir -p $(DOCS)/html cp doc/xml/*.gif doc/xml/*.html $(DOCS)/html/ @@ -181,10 +181,7 @@ install-stamp: build-stamp debian/$(dkmspkg)/usr/src/openafs-$(VERSION) rm -rf debian/$(dkmspkg)/usr/src/openafs-$(VERSION)/debian rmdir debian/$(srcpkg)/usr/src/modules - - set -e; for pkg in $(DOC_PACKAGES) ; do \ - ln -s openafs-client debian/$$pkg/usr/share/doc/$$pkg; \ - done + dh_dkms -V $(VERSION) mv debian/openafs-client/usr/bin/pagsh \ debian/openafs-client/usr/bin/pagsh.openafs @@ -214,31 +211,34 @@ install-stamp: build-stamp install -m 644 debian/openafs-client.NEWS \ debian/$(srcpkg)/usr/share/doc/$(srcpkg)/NEWS.Debian - dh_dkms -V $(VERSION) +# We have multiple init scripts with some non-standard defaults. +override_dh_installinit: + dh_installinit -popenafs-client -r -- defaults 25 20 + dh_installinit -popenafs-fileserver -r + +# Create the documentation symlinks. +override_dh_installdocs: + dh_installdocs $(DOC_PACKAGES) --link-doc=openafs-client + dh_installdocs --remaining-packages + +# Install the upstream NEWS file as the upstream changelog. +override_dh_installchangelogs: dh_installchangelogs NEWS - dh install --after dh_install + +# Override some of our permissions. +override_dh_fixperms: + dh_fixperms chmod 700 debian/openafs-client/var/cache/openafs chmod 700 debian/openafs-dbserver/var/lib/openafs/db chmod 700 debian/openafs-fileserver/var/lib/openafs/local - touch $@ - -binary-indep: install-stamp - dh binary-indep # Only include debugging information for the servers installed into # /usr/lib/openafs rather than for all binaries. The servers are where # debugging backtraces really matter, and a 10MB debugging package is # overkill. -binary-arch: install-stamp - dh binary-arch --before dh_strip +override_dh_strip: dh_strip --dbg-package=openafs-dbg rm -rf debian/openafs-dbg/usr/lib/debug/lib rm -rf debian/openafs-dbg/usr/lib/debug/sbin rm -rf debian/openafs-dbg/usr/lib/debug/usr/bin rm -rf debian/openafs-dbg/usr/lib/debug/usr/sbin - dh binary-arch --after dh_strip - -binary: binary-indep binary-arch - -.PHONY: binary binary-arch binary-indep build build-arch build-indep clean -.PHONY: install -- 2.39.5