From 60172a0ea8d86817ed5837fb7fa63498860f0907 Mon Sep 17 00:00:00 2001 From: Benjamin Kaduk Date: Thu, 23 Oct 2014 16:25:30 -0400 Subject: [PATCH] Succeed when the kmod is missing Otherwise we get an angry message from dpkg and a disabled state. --- debian/openafs-client-precheck | 16 +++++++++++++++- debian/openafs-client.service | 2 +- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/debian/openafs-client-precheck b/debian/openafs-client-precheck index 0dfd6486a..e2927118a 100755 --- a/debian/openafs-client-precheck +++ b/debian/openafs-client-precheck @@ -7,6 +7,7 @@ if [ -f /etc/openafs/afs.conf ]; then fi CACHEINFO=${CACHEINFO:-/etc/openafs/cacheinfo} +MODULEROOT=${MODULEROOT:-/lib/modules/`uname -r`} # Exit if the package is not installed. [ -x /sbin/afsd ] || exit 1 @@ -32,7 +33,19 @@ if [ -z $(/sbin/lsmod | fgrep openafs) ]; then if [ $status -ne 0 ] ; then echo "Failed to load openafs.ko. Does it need to be built?" >&2 - exit $status + # We cannot fail hard on a missing module, though, as that will + # cause our unit to be put in a disabled state. + if $(grep -q openafs "$MODULEROOT/modules.dep"); then + exit $status + else + cat > /var/cache/openafs-client/openafs-client.env < /var/cache/openafs-client/openafs-client.env <