[OpenAFS] Systemd precheck cachefile parse problem

Mike B. Kerber michael.kerber@univie.ac.at
Sat, 12 Jun 2021 19:02:13 +0200


Hi!

I dont know where to report this as ... I am running debian but this
likely affects others.
So i give you problem and solution here, please tell me if i should file
a bugreport elsewhere..

on an upgraded debian system the openafs-client does not start because
the system precheck file complains that the mountpoint is not a directory.

In my case the file was used previously and has comments inside (for
automated install multi-use)

So i included that the check  is only run on no-comment lines (patch
included).

One might extend this to let awk check that the layout of non-comment
lines is indeed
dir:dir:reasonableSize
or similar.

i hope that this helps some people as i found several complains in
multiple places and a fix coming from upstream is welcome...

Thanks a lot for your work (and welcoming any dual-license openafs!)

-michael

Here is the patch that works for me:


--- /usr/share/openafs/openafs-client-precheck.orig	2021-06-12
17:36:36.223203380 +0200
+++ /usr/share/openafs/openafs-client-precheck	2021-06-12
17:37:22.911578894 +0200
@@ -53,7 +53,7 @@
     echo "required cacheinfo file does not exist" >&2
     exit 1
 fi
-if ! [ -d "$(awk -F : '{print $1}' < "${CACHEINFO}")" ]; then
+if ! [ -d "$(awk -F : '/^[^#]/ {print $1}' < "${CACHEINFO}")" ]; then
     echo "AFS mountpoint is not a directory or does not exist" >&2
     exit 1
 fi