Skip to content

Spurious ownership fix on every start when directory group differs from owner's primary group #2570

@f-barth

Description

@f-barth

Description

Commit 7c07d3a ("Make it easier to run eth-docker with an app user", PR #2545) changed __owner_group from id -gn "${__owner}" (owner's primary group) to ls -ld . | awk '{print $4}' (directory's group).

The PR's intent was to support a multi-admin setup: an app user node owns eth-docker, a group like node-admins has directory ownership with setgid set, and multiple admins can manage the node. With setgid, new files inherit the directory's group, so using the directory group is correct.

However, in the common single-user setup without setgid, new files inherit the creator's primary group, not the directory group. When these differ (e.g., directory is cthulhu:docker but primary group is cthulhu), the ownership check in __prep_conffiles sees a perpetual mismatch and "fixes" .env on every start, producing spurious "Fixing ownership" messages.

Steps to Reproduce

  1. Have a user whose primary group differs from the directory's group (e.g., directory owned by cthulhu:docker, user's primary group is cthulhu)
  2. Run ./ethd up or any command that triggers __prep_conffiles
  3. Observe "Fixing ownership" messages on every invocation, even though ownership is correct

Expected Behavior

No "Fixing ownership" message when the files already have the correct owner and group.

Proposed Fix

Check whether the setgid bit is set on the directory:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions