]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
logrotate.conf: fixes for systemd
authorNathan Cutler <ncutler@suse.com>
Fri, 26 Jun 2015 11:13:33 +0000 (13:13 +0200)
committerNathan Cutler <ncutler@suse.com>
Tue, 27 Oct 2015 10:24:16 +0000 (11:24 +0100)
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)

ceph.spec.in
debian/control
src/logrotate.conf
systemd/ceph-mds@.service
systemd/ceph-mon@.service
systemd/ceph-osd@.service

index 140e0e3141a8d7bc679de7109f026c869456efbc..44a988676d15ab613a77079a362ec7c0883ef171 100644 (file)
@@ -33,6 +33,7 @@ Requires:     python-cephfs = %{epoch}:%{version}-%{release}
 Requires:      python
 Requires:      python-requests
 Requires:      python-flask
+Requires:      grep
 Requires:      xfsprogs
 Requires:      parted
 Requires:      util-linux
index bbb871f450b6767bae4d0c3c67e2865ea35081d8..58ac6974ff5d9ee17ac4eb2aebfdbfa5d00f26c4 100644 (file)
@@ -63,6 +63,7 @@ Depends: binutils,
          ceph-common (>= 0.94.2-2),
          cryptsetup-bin | cryptsetup,
          gdisk,
+         grep,
          parted,
          python,
          python-argparse,
index 9ae27baee45e1c8b5c6b3ae3ad22b1329f1ddbe7..a2eb896daac1d9d9078d30b45e3fcb1543a94fc7 100644 (file)
@@ -8,6 +8,10 @@
             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
index 22a787d60b4156f7f3f25ce99baf48fa0144b7fb..aec46fd4eee8787464d46dab32689f92b77650dc 100644 (file)
@@ -8,6 +8,7 @@ PartOf=ceph.target
 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
index c3d260989d7f98e8b6f295ffd68c029a44cb5879..421897dc0d0dac7438f87e71db12ac65f1c070aa 100644 (file)
@@ -15,6 +15,7 @@ PartOf=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
index c12b56c9fb97207084342a098540938b19ee8c1a..3c778056c1687ba575058d851b4ab02748125c1e 100644 (file)
@@ -10,6 +10,7 @@ Environment=CLUSTER=ceph
 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