Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automatically add Longhorn device to the group id 6 (disk group) by default #79

Merged
merged 1 commit into from
Mar 8, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions util/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,11 @@ func DuplicateDevice(dev *KernelDevice, dest string) error {
if err := os.Chmod(dest, 0660); err != nil {
return errors.Wrapf(err, "cannot change permission of the device %s", dest)
}
// We use the group 6 by default because this is common group for disks
// See more at https://github.com/longhorn/longhorn/issues/8088#issuecomment-1982300242
if err := os.Chown(dest, 0, 6); err != nil {
return errors.Wrapf(err, "cannot change ownership of the device %s", dest)
}
return nil
}

Expand Down