]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
logrotate: fix log rotation with systemd 5446/head
authorSage Weil <sage@redhat.com>
Mon, 3 Aug 2015 18:41:28 +0000 (14:41 -0400)
committerSage Weil <sage@redhat.com>
Mon, 3 Aug 2015 18:41:43 +0000 (14:41 -0400)
systemctl does not have a nice way to enumerate (active) units so we can
reload them.  On centos7, the is-active wildcard syntax does not appear to
be supported.  On fedora 22, it prints the state only but not which unit
the state belongs to.

Simply killall -1 instead.

Signed-off-by: Sage Weil <sage@redhat.com>
src/logrotate.conf
src/rgw/logrotate.conf

index a2eb896daac1d9d9078d30b45e3fcb1543a94fc7..5888f20db987d7ed084b1ad3fd1ca40a10649725 100644 (file)
@@ -9,9 +9,8 @@
         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
+           # systemd does not provide an easy way to list (active) units
+           killall -q -1 ceph-mon ceph-mds ceph-osd
         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 6cdfd13c251fbbf0c5171e550766e5444c61e674..f1dc58af3323350c3415dbe22fa66fa8adc4ced6 100644 (file)
@@ -8,6 +8,9 @@
             service ceph-radosgw reload >/dev/null
         elif which invoke-rc.d > /dev/null 2>&1 && [ -x `which invoke-rc.d` ]; then
             invoke-rc.d radosgw reload >/dev/null
+        elif which systemctl > /dev/null 2>&1 && [ -x `which systemctl` ]; then
+           # systemd does not provide an easy way to list (active) units
+           killall -q -1 radosgw
         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