]> git.proxmox.com Git - ceph.git/blob - ceph/systemd/ceph-mgr@.service
421860163133af9bc5b6780f6888df0e1f28b9bc
[ceph.git] / ceph / systemd / ceph-mgr@.service
1 [Unit]
2 Description=Ceph cluster manager daemon
3 After=network-online.target local-fs.target time-sync.target ceph-mon@%i.service
4 Wants=network-online.target local-fs.target time-sync.target
5 PartOf=ceph-mgr.target ceph-mon@%i.service
6
7 [Service]
8 LimitNOFILE=1048576
9 LimitNPROC=1048576
10 EnvironmentFile=-/etc/sysconfig/ceph
11 Environment=CLUSTER=ceph
12
13 # This ExecStartPre business is a hack to inject a key for the mgr daemon,
14 # using whatever key already exists on the mon on this node to gain sufficient
15 # permissions to create the mgr key. Failure is ignored at every step (the
16 # '-' prefix) in case someone has already used some other trick to set
17 # everything up manually.
18 # `sh -c "exec ..."` is required, since different Linux ditributives have different rules on absolute paths of that executables.
19 # systemd requires to use absoulte paths.
20 ExecStartPre=-/bin/sh -c "exec mkdir -p /var/lib/ceph/mgr/${CLUSTER}-%i"
21 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"
22 ExecStartPre=-/bin/sh -c "exec chown -R ceph.ceph /var/lib/ceph/mgr/${CLUSTER}-%i"
23 ExecStartPre=-/usr/bin/ceph -i /var/lib/ceph/mgr/${CLUSTER}-%i/keyring auth add mgr.%i mon 'allow profile mgr' osd 'allow *' mds 'allow *' --keyring=/var/lib/ceph/mon/${CLUSTER}-%i/keyring --name=mon.
24
25 ExecStart=/usr/bin/ceph-mgr -f --cluster ${CLUSTER} --id %i --setuser ceph --setgroup ceph
26 ExecReload=/bin/kill -HUP $MAINPID
27 Restart=on-failure
28 StartLimitInterval=30min
29 StartLimitBurst=3
30
31 [Install]
32 WantedBy=ceph-mgr.target