Commit 4af66bd5 authored by Vladimir Bashkirtsev's avatar Vladimir Bashkirtsev

Allow ceph to use smartctl and nvme commands as root

parent eb8d7c70
all: ceph-config all: ceph-config ceph-sudoer
rm /etc/passwd rm /etc/passwd
mv -v /data/etc/passwd /etc/passwd mv -v /data/etc/passwd /etc/passwd
rm /etc/group rm /etc/group
...@@ -81,8 +81,9 @@ all: ceph-config ...@@ -81,8 +81,9 @@ all: ceph-config
ln -s ../dist /usr/share/ceph/mgr/dashboard/frontend/dist/en-US ln -s ../dist /usr/share/ceph/mgr/dashboard/frontend/dist/en-US
@echo "$$CEPH_CONFIG" >> /etc/config/ceph @echo "$$CEPH_CONFIG" > /etc/config/ceph
install -v -Dm755 ceph /usr/share/easycwmp/functions install -v -Dm755 ceph /usr/share/easycwmp/functions
@echo "$$CEPH_SUDOER" > /etc/sudoers.d/ceph
sed -e 's|^Environment=.*|ExecStartPre=/usr/sbin/ceph-mon-bootstrap|' -i /lib/systemd/system/ceph-mon@.service sed -e 's|^Environment=.*|ExecStartPre=/usr/sbin/ceph-mon-bootstrap|' -i /lib/systemd/system/ceph-mon@.service
...@@ -119,3 +120,12 @@ config ceph 'client' ...@@ -119,3 +120,12 @@ config ceph 'client'
option admin '' option admin ''
endef endef
export CEPH_CONFIG export CEPH_CONFIG
ceph-sudoer:
define CEPH_SUDOER
## allow ceph daemons (which run as user ceph) to collect device health metrics
ceph ALL=NOPASSWD: /usr/sbin/smartctl -x --json=o /dev/*
ceph ALL=NOPASSWD: /usr/sbin/nvme * smart-log-add --json /dev/*
endef
export CEPH_SUDOER
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment