Skip to content

Commit

Permalink
Set owner-only RWX for etcd dir
Browse files Browse the repository at this point in the history
  • Loading branch information
cvlc committed Jan 12, 2022
1 parent 7931287 commit d96c53b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion ebs.go
Original file line number Diff line number Diff line change
Expand Up @@ -185,10 +185,13 @@ func ensureVolumeMounted(blockDeviceOS, mountPoint string) error {
}

func ensureVolumeWriteable(mountPoint string) error {
log.Printf("Ensuring %s is r/w by etcd\n", mountPoint)
log.Printf("Ensuring %s is r/w by etcd only\n", mountPoint)
if err := exec.Command("sudo", "/usr/bin/chown", "-R", "etcd:etcd", mountPoint).Run(); err != nil {
return errors.Wrapf(err, "cannot make %s writeable by etcd", mountPoint)
}
if err := exec.Command("sudo", "/usr/bin/chmod", "-R", "700", mountPoint).Run(); err != nil {
return errors.Wrapf(err, "cannot set permissions on %s for etcd", mountPoint)
}

return nil
}

0 comments on commit d96c53b

Please sign in to comment.