Skip to content

dlck: warn when running not as root or a daos_server group member#17208

Open
janekmi wants to merge 8 commits intomasterfrom
janekmi/DAOS-18268-warn-not-root-or-daos_server
Open

dlck: warn when running not as root or a daos_server group member#17208
janekmi wants to merge 8 commits intomasterfrom
janekmi/DAOS-18268-warn-not-root-or-daos_server

Conversation

@janekmi
Copy link
Contributor

@janekmi janekmi commented Dec 2, 2025

Steps for the author:

  • Commit message follows the guidelines.
  • Appropriate Features or Test-tag pragmas were used.
  • Appropriate Functional Test Stages were run.
  • At least two positive code reviews including at least one code owner from each category referenced in the PR.
  • Testing is complete. If necessary, forced-landing label added and a reason added in a comment.

After all prior steps are complete:

  • Gatekeeper requested (daos-gatekeeper added as a reviewer).

Signed-off-by: Jan Michalski <jan-marian.michalski@hpe.com>
@janekmi janekmi requested review from Nasf-Fan and rpadma2 December 2, 2025 13:56
@janekmi janekmi added the CR Catastrophic Recovery Feature label Dec 2, 2025
@github-actions
Copy link

github-actions bot commented Dec 2, 2025

Errors are component not formatted correctly,Ticket number prefix incorrect,PR title is malformatted. See https://daosio.atlassian.net/wiki/spaces/DC/pages/11133911069/Commit+Comments,Unable to load ticket data
https://daosio.atlassian.net/browse/dlck:

@daosbuild3
Copy link
Collaborator

... daos/mgmt.h, fix error handling when getpwuid() fails, and introduce
DLCK_FAULT_GETPWUID fault injection point to test the getpwuid() fail
scenario.

Signed-off-by: Jan Michalski <jan-marian.michalski@hpe.com>
@janekmi janekmi requested a review from Nasf-Fan December 3, 2025 15:01
@daosbuild3
Copy link
Collaborator

Nasf-Fan
Nasf-Fan previously approved these changes Dec 4, 2025
ret = d_errno2der(errno);
CK_PRINTFL_RC(ck, ret, "Cannot get the name of a user for uid=%" PRIuMAX,
(uintmax_t)euid);
CK_PRINT(ck, UNEXPECTED_USER_WARNING_MSG);
Copy link
Contributor

Choose a reason for hiding this comment

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

If possible, I would suggest to merge the CK_PRINT and above CK_PRINTFL_RC into one call since the print logic can handle complex-formatted message.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It won't look good. CK_PRINTFL_RC() appends the rc description at the end of the message. The rc is related to the operation itself not the warning message.

Obviously, we could break down CK_PRINTFL_RC() and print rc description in the correct place manually but I find it cumbersome when a proper macro exists. Using a dedicated macro when printing an rc description is better compared to constructing a print format each time since it guarantees consistency.

Let's leave it as it is for now.

}

CK_PRINTF(ck, EFFECTIVE_USER_STR "%s (uid=%" PRIuMAX ")\n", pw->pw_name, (uintmax_t)euid);
CK_PRINT(ck, UNEXPECTED_USER_WARNING_MSG);
Copy link
Contributor

Choose a reason for hiding this comment

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

Similar as above merge suggestion.

@daosbuild3
Copy link
Collaborator

Test stage Functional Hardware Medium MD on SSD completed with status FAILURE. https://jenkins-3.daos.hpc.amslabs.hpecorp.net//job/daos-stack/job/daos/view/change-requests/job/PR-17208/3/execution/node/1357/log

Skip already passed stages.

Skip-unit-test-memcheck: true
Skip-func-test-vm: true
Skip-func-hw-test-medium-verbs-provider: true
Skip-func-hw-test-large-md-on-ssd: true

Signed-off-by: Jan Michalski <jan-marian.michalski@hpe.com>
@daosbuild3
Copy link
Collaborator

@daosbuild3
Copy link
Collaborator

Test stage Functional Hardware Medium MD on SSD completed with status FAILURE. https://jenkins-3.daos.hpc.amslabs.hpecorp.net//job/daos-stack/job/daos/view/change-requests/job/PR-17208/4/execution/node/1009/log

@daosbuild3
Copy link
Collaborator

@daosbuild3
Copy link
Collaborator

…warn-not-root-or-daos_server

Signed-off-by: Jan Michalski <jan-marian.michalski@hpe.com>
... group member

Signed-off-by: Jan Michalski <jan-marian.michalski@hpe.com>
@janekmi janekmi changed the title DAOS-18268 dlck: warn when running not as root or daos_server dlck: warn when running not as root or a daos_server group member Feb 5, 2026
@janekmi janekmi requested a review from Nasf-Fan February 5, 2026 18:25
@janekmi
Copy link
Contributor Author

janekmi commented Feb 5, 2026

@Nasf-Fan @rpadma2 I updated this warning to reflect the work done here: https://daosio.atlassian.net/browse/DAOS-18324

All new pools now can be maintained (via DDB/DLCK) by users belonging to the daos_server groups as well as by root.
Older pools are expected to follow suite: https://daosio.atlassian.net/browse/DAOS-18571

Signed-off-by: Jan Michalski <jan-marian.michalski@hpe.com>
Signed-off-by: Jan Michalski <jan-marian.michalski@hpe.com>
@daosbuild3
Copy link
Collaborator

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CR Catastrophic Recovery Feature

Development

Successfully merging this pull request may close these issues.

3 participants