]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
systemd: Add systemd sandboxing to services. 7401/head
authorPatrick Donnelly <batrick@batbytes.com>
Thu, 28 Jan 2016 02:17:14 +0000 (21:17 -0500)
committerPatrick Donnelly <batrick@batbytes.com>
Thu, 28 Jan 2016 15:50:00 +0000 (10:50 -0500)
This change makes it so the mon/osd/mds/radosgw daemons:
    o Cannot write to /usr, /etc, and /boot.
    o Cannot access /home, /root, or /run/user.
    o Each daemon gets its own private /tmp and /var/tmp.
    o All daemons get a private /dev without physical devices (exception: osd)

I'm not sure if the osd daemon needs access to a full /dev so I left
ProtectDevices out for ceph-osd@.service.

Signed-off-by: Patrick Donnelly <batrick@batbytes.com>
systemd/ceph-mds@.service
systemd/ceph-mon@.service
systemd/ceph-osd@.service
systemd/ceph-radosgw@.service

index 708f42c815420eac87721a4036460826d84ea7ce..e12258058c74bbf6ec6b6d976a0b004e19aa907d 100644 (file)
@@ -11,6 +11,10 @@ EnvironmentFile=-/etc/sysconfig/ceph
 Environment=CLUSTER=ceph
 ExecStart=/usr/bin/ceph-mds -f --cluster ${CLUSTER} --id %i --setuser ceph --setgroup ceph
 ExecReload=/bin/kill -HUP $MAINPID
+PrivateDevices=yes
+ProtectHome=true
+ProtectSystem=full
+PrivateTmp=true
 
 [Install]
 WantedBy=ceph-mds.target
index 03a9b6c19e33999bbb81c6c865422bdfb0b80925..a8d427b5ab5ee862a9f23407810c608aacb538f9 100644 (file)
@@ -17,6 +17,10 @@ EnvironmentFile=-/etc/sysconfig/ceph
 Environment=CLUSTER=ceph
 ExecStart=/usr/bin/ceph-mon -f --cluster ${CLUSTER} --id %i --setuser ceph --setgroup ceph
 ExecReload=/bin/kill -HUP $MAINPID
+PrivateDevices=yes
+ProtectHome=true
+ProtectSystem=full
+PrivateTmp=true
 
 [Install]
 WantedBy=ceph-mon.target
index 82dabdfe38df130450e9ad45ecb90d65e07a802a..1e120c46f1ba62c1d368b7b7fde3db58956cd842 100644 (file)
@@ -12,6 +12,9 @@ Environment=CLUSTER=ceph
 ExecStart=/usr/bin/ceph-osd -f --cluster ${CLUSTER} --id %i --setuser ceph --setgroup ceph
 ExecStartPre=/usr/libexec/ceph/ceph-osd-prestart.sh --cluster ${CLUSTER} --id %i --setuser ceph --setgroup ceph
 ExecReload=/bin/kill -HUP $MAINPID
+ProtectHome=true
+ProtectSystem=full
+PrivateTmp=true
 
 [Install]
 WantedBy=ceph-osd.target
index fb09e190d61f42b1a0b57ee3a58d230579b560e2..66d9eb85a2d96413d6aa5dc649caefddb7507b51 100644 (file)
@@ -10,6 +10,10 @@ LimitNPROC=1048576
 EnvironmentFile=-/etc/sysconfig/ceph
 Environment=CLUSTER=ceph
 ExecStart=/usr/bin/radosgw -f --cluster ${CLUSTER} --name client.%i --setuser ceph --setgroup ceph
+PrivateDevices=yes
+ProtectHome=true
+ProtectSystem=full
+PrivateTmp=true
 
 [Install]
 WantedBy=ceph-radosgw.target