]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
redhat: do not overwite the server CellServDB
authorMichael Meffie <mmeffie@sinenomine.net>
Thu, 13 Nov 2014 17:12:12 +0000 (12:12 -0500)
committerJeffrey Altman <jaltman@your-file-system.com>
Mon, 15 Dec 2014 03:40:07 +0000 (22:40 -0500)
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.

Change-Id: I802fd8d85f73946ca8d8d57e115abb8ae6958196
Reviewed-on: http://gerrit.openafs.org/11601
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
src/packaging/RedHat/openafs-client.init
src/packaging/RedHat/openafs.spec.in

index caaf89095b446d298206f553b41db6fb4190fbad..579085cb292a22d0f8563246e3ef67b3b85f4136 100644 (file)
 
 
 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"
index eb27950731fc3e20e113151ec8a45e647455f347..347ffc2a8831f6f45a7a4776426a25090f9449fb 100644 (file)
@@ -1368,6 +1368,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 )