From a3ac0f52e0c97bd3c3e37322e4759d653e76a82f Mon Sep 17 00:00:00 2001 From: Michael Meffie Date: Thu, 13 Nov 2014 12:12:12 -0500 Subject: [PATCH] redhat: do not overwite the server CellServDB The bosserver creates a pair of symlinks in the client's configuration directory (/usr/vice/etc) during startup, if the configuration files are not present: /usr/vice/etc/CellServDB -> /usr/afs/etc/CellServDB /usr/vice/etc/ThisCell -> /usr/afs/etc/ThisCell Due to a bug in the bosserver (which is not fixed on 1.6.x), the symlinks are only created when the /usr/vice/etc directory already exists when the bosserver is started. If the bosserver is started before the client is installed (and the /usr/vice/etc directory is present), then the packaging script will write to the symlink CellServDB, overwriting the server's CellServDB with the contents of the client's CellServDB.local and CellServDB.dist files. Also, if the client is started after the bosserver creates the symlinks, the client init script will overwrite the server's CellServDB with the contents of the client's CellServDB.local and CellServDB.dist files. Update the packaging and the client init script to delete this symlink if present, since it is only intended to provide stub configuration for the client utilities while setting up an initial server. Then, the updating of the CellServDB will create a local file, instead of following the symlink and overwriting the server CellServDB. While here, adjust the indentation whitespace to match the tabs below. Reviewed-on: http://gerrit.openafs.org/11601 Reviewed-by: Benjamin Kaduk Tested-by: BuildBot (cherry picked from commit 75d67780b42c1a7bfa506fcd230b28a6f293fcbd) Change-Id: I7f899c7ea35d5df6a2e846a0354717fd51e2eba4 Reviewed-on: http://gerrit.openafs.org/12081 Tested-by: BuildBot Reviewed-by: Michael Meffie Reviewed-by: Mark Vitale Reviewed-by: Stephan Wiesand --- src/packaging/RedHat/openafs-client.init | 13 ++++++++----- src/packaging/RedHat/openafs.spec.in | 3 +++ 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/src/packaging/RedHat/openafs-client.init b/src/packaging/RedHat/openafs-client.init index caaf89095..579085cb2 100644 --- a/src/packaging/RedHat/openafs-client.init +++ b/src/packaging/RedHat/openafs-client.init @@ -13,11 +13,14 @@ start() { - echo -n $"Updating CellServDB: " - cat /usr/vice/etc/CellServDB.local /usr/vice/etc/CellServDB.dist > \ - /usr/vice/etc/CellServDB - chmod 644 /usr/vice/etc/CellServDB - echo + if [ -h /usr/vice/etc/CellServDB ]; then + rm -f /usr/vice/etc/CellServDB + fi + echo -n $"Updating CellServDB: " + cat /usr/vice/etc/CellServDB.local /usr/vice/etc/CellServDB.dist > \ + /usr/vice/etc/CellServDB + chmod 644 /usr/vice/etc/CellServDB + echo echo -n $"Starting openafs-client: " if [ -e /var/lock/subsys/openafs-client ] ; then echo -n $"cannot start openafs-client: already running" diff --git a/src/packaging/RedHat/openafs.spec.in b/src/packaging/RedHat/openafs.spec.in index 8cfd6ab03..1bf4b7ab2 100644 --- a/src/packaging/RedHat/openafs.spec.in +++ b/src/packaging/RedHat/openafs.spec.in @@ -1371,6 +1371,9 @@ fi [ -f /usr/vice/etc/CellServDB.local ] || touch /usr/vice/etc/CellServDB.local ( cd /usr/vice/etc ; \ + if [ -h CellServDB ]; then \ + rm -f CellServDB; \ + fi; \ cat CellServDB.local CellServDB.dist > CellServDB ; \ chmod 644 CellServDB ) -- 2.39.5