cephadm.postinst can fail if cephadm was originally installed using a
version that didn't configure a home directory for the user at all.
Newer versions do configure a home directory (as either `/home/cephadm`
or `/var/lib/cephadm`) so if that is configured then nothing needs to be
done. But if the user was created with no home directory then one needs
to be added for the configure step to succeed.
Fixes: https://tracker.ceph.com/issues/72083
commit
90bc0369243077c2aaf67f0de2bab5810b217f4e added home directories
for new cephadm users created, but didn't add home directories to
cephadm users that already existed.
Signed-off-by: Elliot Courant <me@elliotcourant.dev>
usermod -U cephadm
fi
+ # Older versions may not have configured a home directory.
+ # If they don't have one configured then add it.
+ if ! test ~cephadm = "/nonexistent"; then
+ usermod --home /var/lib/cephadm -m cephadm
+ fi
+
# set up (initially empty) .ssh/authorized_keys file
if ! test -d ~cephadm/.ssh; then
mkdir ~cephadm/.ssh