From: Elliot Courant Date: Mon, 24 Nov 2025 17:50:56 +0000 (-0600) Subject: deb/cephadm: Don't assume a home directory is configured X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=65e2a33ee7b290b8f6cee69ac90359710d806d13;p=ceph.git deb/cephadm: Don't assume a home directory is configured 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 --- diff --git a/debian/cephadm.postinst b/debian/cephadm.postinst index b586ee7183d7..f01e7430cc91 100644 --- a/debian/cephadm.postinst +++ b/debian/cephadm.postinst @@ -41,6 +41,12 @@ case "$1" in 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