Skip to content

deb/cephadm: add explicit --home for cephadm user#64459

Merged
tchaikov merged 1 commit intoceph:mainfrom
cbodley:wip-72083
Jul 20, 2025
Merged

deb/cephadm: add explicit --home for cephadm user#64459
tchaikov merged 1 commit intoceph:mainfrom
cbodley:wip-72083

Conversation

@cbodley
Copy link
Contributor

@cbodley cbodley commented Jul 11, 2025

cephadm.postinst fails on ubuntu 24.04, because the cephadm user it creates ends up with a /nonexistent home directory:

mkdir: cannot create directory '/nonexistent/.ssh': No such file or directory

on ubuntu 22.04, this user's home directory is /home/cephadm

the adduser man page for 24.04 includes this new text:

If no home directory is specified, the default home directory for a new system user is /nonexistent. This directory should never exist on any Debian system, and adduser will never create it automatically.

add the explicit --home /home/cephadm to preserve the existing behavior

commit cbodley@90bc036 had previously added --home /home/cephadm, but that was later removed by commit cbodley@c5a316c to support non-default home directories. the latter commit's author recommends use of --home /var/lib/cephadm instead

Fixes: https://tracker.ceph.com/issues/72083

Show available Jenkins commands

@tchaikov
Copy link
Contributor

will review this change tomorrow.

@cbodley
Copy link
Contributor Author

cbodley commented Jul 11, 2025

cc @NVShawn @mcv21

@NVShawn
Copy link
Contributor

NVShawn commented Jul 12, 2025

This will break machines where /home is not where local accounts are made. adduser is causing a breaking change and forcing it on us.

I suggest /var/lib/cephadm be set as the home directory, as this will get around both the original issue (/home being automounted or otherwise inapproprate) and the new issue of adduser's breaking change.

@cbodley
Copy link
Contributor Author

cbodley commented Jul 16, 2025

I suggest /var/lib/cephadm be set as the home directory, as this will get around both the original issue (/home being automounted or otherwise inapproprate) and the new issue of adduser's breaking change.

thanks @NVShawn. i'm guessing it's safe to change this, as it won't effect existing cephadm users. it looks like we did check in #62507 for explicit mentions of /home/cephadm, but may not have caught everything - our tests are probably still using the default /home/cephadm

if @adk3798 doesn't object, i'll make this change and we'll rely on testing to uncover any issues

cephadm.postinst fails on ubuntu 24.04, because the cephadm user it
creates ends up with a `/nonexistent` home directory:

> mkdir: cannot create directory '/nonexistent/.ssh': No such file or directory

on ubuntu 22.04, this user's home directory is `/home/cephadm`

the `adduser` man page for 24.04 includes this new text:
> If no home directory is specified, the default home directory for a new system user is /nonexistent. This directory should never exist on any Debian system, and adduser will never create it automatically.

commit 90bc036 had previously added
`--home /home/cephadm`, but that was later removed by commit
c5a316c to support non-default home
directories. the latter commit's author recommends use of
`--home /var/lib/cephadm` instead

Fixes: https://tracker.ceph.com/issues/72083

Signed-off-by: Casey Bodley <cbodley@redhat.com>
@adk3798
Copy link
Contributor

adk3798 commented Jul 16, 2025

I suggest /var/lib/cephadm be set as the home directory, as this will get around both the original issue (/home being automounted or otherwise inapproprate) and the new issue of adduser's breaking change.

thanks @NVShawn. i'm guessing it's safe to change this, as it won't effect existing cephadm users. it looks like we did check in #62507 for explicit mentions of /home/cephadm, but may not have caught everything - our tests are probably still using the default /home/cephadm

if @adk3798 doesn't object, i'll make this change and we'll rely on testing to uncover any issues

no objections from me

Copy link
Contributor

@tchaikov tchaikov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@adk3798
Copy link
Contributor

adk3798 commented Jul 17, 2025

@adk3798
Copy link
Contributor

adk3798 commented Jul 17, 2025

jenkins test api

@cbodley
Copy link
Contributor Author

cbodley commented Jul 17, 2025

No new failures related to this PR

thanks Adam!

i tested this against ubuntu 24.04 in https://qa-proxy.ceph.com/teuthology/cbodley-2025-07-17_18:13:22-rgw:verify-wip-72083-distro-default-smithi/8393570/teuthology.log, and package installation succeeded. 👍 the cluster goes on to crash and burn shortly after, but i think this is ready to merge

@tchaikov tchaikov merged commit bffa446 into ceph:main Jul 20, 2025
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants