Before this patch, the command 'logrotate -f /etc/logrotate.d/ceph'
was generating an error "Failed to reload ceph.target: Job type reload is not
applicable for unit ceph.target".
Before we issue systemctl reload, check that there is at least
one active ceph-* service. (The hyphen is significant.)
Since we use grep, make the grep package a dependency.
http://tracker.ceph.com/issues/12173 Fixes: #12173
Signed-off-by: Tim Serong <tserong@suse.com>
Signed-off-by: Lars Marowsky-Bree <lmb@suse.com>
Signed-off-by: Nathan Cutler <ncutler@suse.com>
(cherry picked from commit
05424a803b817068f0a06b0ac6709aa8a8a3a717)
Requires: python
Requires: python-requests
Requires: python-flask
+Requires: grep
Requires: xfsprogs
Requires: parted
Requires: util-linux
ceph-common (>= 0.94.2-2),
cryptsetup-bin | cryptsetup,
gdisk,
+ grep,
parted,
python,
python-argparse,
service ceph reload >/dev/null
elif which invoke-rc.d > /dev/null 2>&1 && [ -x `which invoke-rc.d` ]; then
invoke-rc.d ceph reload >/dev/null
+ elif which systemctl > /dev/null 2>&1 && [ -x `which systemctl` ]; then
+ if systemctl is-active 'ceph-*' | grep -i active > /dev/null 2>&1 ; then
+ systemctl reload 'ceph-*' >/dev/null || :
+ fi
fi
# Possibly reload twice, but depending on ceph.conf the reload above may be a no-op
if which initctl > /dev/null 2>&1 && [ -x `which initctl` ]; then
EnvironmentFile=-/etc/sysconfig/ceph
Environment=CLUSTER=ceph
ExecStart=/usr/bin/ceph-mds -f --cluster ${CLUSTER} --id %i
+ExecReload=/bin/kill -HUP $MAINPID
[Install]
WantedBy=ceph.target
EnvironmentFile=-/etc/sysconfig/ceph
Environment=CLUSTER=ceph
ExecStart=/usr/bin/ceph-mon -f --cluster ${CLUSTER} --id %i
+ExecReload=/bin/kill -HUP $MAINPID
[Install]
WantedBy=ceph.target
ExecStart=/usr/bin/ceph-osd -f --cluster ${CLUSTER} --id %i
ExecStartPre=/usr/libexec/ceph/ceph-osd-prestart.sh --cluster ${CLUSTER} --id %i
LimitNOFILE=131072
+ExecReload=/bin/kill -HUP $MAINPID
[Install]
WantedBy=ceph.target