Skip to content

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

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

tchaikov merged 1 commit into
ceph:mainfrom
cbodley:wip-72083

Conversation

@cbodley

@cbodley cbodley commented Jul 11, 2025 •

Copy link
Copy Markdown
Contributor

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
Copy Markdown
Contributor

will review this change tomorrow.

@cbodley

cbodley commented Jul 11, 2025

Copy link
Copy Markdown
Contributor Author

cc @NVShawn @mcv21

@NVShawn

NVShawn commented Jul 12, 2025

Copy link
Copy Markdown
Contributor

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.

Comment thread debian/cephadm.postinst Resolved
@cbodley

cbodley commented Jul 16, 2025

Copy link
Copy Markdown
Contributor Author

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 <[email protected]>
@adk3798

adk3798 commented Jul 16, 2025

Copy link
Copy Markdown
Contributor

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

@tchaikov tchaikov left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

lgtm

@adk3798

adk3798 commented Jul 17, 2025

Copy link
Copy Markdown
Contributor

@adk3798

adk3798 commented Jul 17, 2025

Copy link
Copy Markdown
Contributor

jenkins test api

@cbodley

cbodley commented Jul 17, 2025

Copy link
Copy Markdown
Contributor Author

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

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