summaryrefslogtreecommitdiffstats
path: root/systemd
diff options
context:
space:
mode:
authorMark Korenberg <socketpair@gmail.com>2016-12-18 13:54:13 +0100
committerMark Korenberg <socketpair@gmail.com>2016-12-18 14:07:21 +0100
commit2ccd02a838ee92ec0ba4c9800f61b7df159d75a1 (patch)
treebffab91b6c7e155ca2fc13a6baf1c22c8c8dc6cb /systemd
parentMerge pull request #12531 from dachary/wip-18291-bluestore (diff)
downloadceph-2ccd02a838ee92ec0ba4c9800f61b7df159d75a1.tar.xz
ceph-2ccd02a838ee92ec0ba4c9800f61b7df159d75a1.zip
Fix startup of Ceph cluster manager daemon on Debian 8
Signed-off-by: Mark Korenberg <socketpair@gmail.com>
Diffstat (limited to 'systemd')
-rw-r--r--systemd/ceph-mgr@.service8
1 files changed, 5 insertions, 3 deletions
diff --git a/systemd/ceph-mgr@.service b/systemd/ceph-mgr@.service
index 6b81f21ac39..4de0b8c2d9f 100644
--- a/systemd/ceph-mgr@.service
+++ b/systemd/ceph-mgr@.service
@@ -14,9 +14,11 @@ Environment=CLUSTER=ceph
# permissions to create the mgr key. Failure is ignored at every step (the
# '-' prefix) in case someone has already used some other trick to set
# everything up manually.
-ExecStartPre=-/usr/bin/mkdir -p /var/lib/ceph/mgr/${CLUSTER}-%i
-ExecStartPre=-/usr/bin/sh -c "[ -f /var/lib/ceph/mgr/${CLUSTER}-%i/keyring ] || /usr/bin/ceph-authtool --create-keyring --gen-key --name=mgr.%i /var/lib/ceph/mgr/${CLUSTER}-%i/keyring"
-ExecStartPre=-/usr/bin/chown -R ceph.ceph /var/lib/ceph/mgr/${CLUSTER}-%i
+# `sh -c "exec ..."` is required, since different Linux ditributives have different rules on absolute paths of that executables.
+# systemd requires to use absoulte paths.
+ExecStartPre=-/bin/sh -c "exec mkdir -p /var/lib/ceph/mgr/${CLUSTER}-%i"
+ExecStartPre=-/bin/sh -c "[ -f /var/lib/ceph/mgr/${CLUSTER}-%i/keyring ] || /usr/bin/ceph-authtool --create-keyring --gen-key --name=mgr.%i /var/lib/ceph/mgr/${CLUSTER}-%i/keyring"
+ExecStartPre=-/bin/sh -c "exec chown -R ceph.ceph /var/lib/ceph/mgr/${CLUSTER}-%i"
ExecStartPre=-/usr/bin/ceph -i /var/lib/ceph/mgr/${CLUSTER}-%i/keyring auth add mgr.%i mon 'allow *' --keyring=/var/lib/ceph/mon/${CLUSTER}-%i/keyring --name=mon.
ExecStart=/usr/bin/ceph-mgr -f --cluster ${CLUSTER} --id %i --setuser ceph --setgroup ceph
ExecReload=/bin/kill -HUP $MAINPID