]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
logrotate: reload all upstart instances
authorSage Weil <sage@inktank.com>
Thu, 21 Jun 2012 19:42:53 +0000 (12:42 -0700)
committerSage Weil <sage@inktank.com>
Thu, 21 Jun 2012 19:43:00 +0000 (12:43 -0700)
upstart doesn't let you wildcard all instances of a given job, so we
slog through initctl list output, and reload any running daemons.

Signed-off-by: Sage Weil <sage@inktank.com>
Reviewed-by: Tommi Virtanen <tv@inktank.com>
src/logrotate.conf

index 3ff5d687b9f8f8a1f6e45f93df9501d1a313af7f..ba7e176669323d9176d033ba223e92d2a1767130 100644 (file)
@@ -5,6 +5,16 @@
     sharedscripts
     postrotate
         invoke-rc.d ceph reload >/dev/null || service ceph reload >/dev/null
+
+       # upstart reload isn't very helpful here:
+       #   https://bugs.launchpad.net/upstart/+bug/1012938
+       for type in mon osd mds; do
+           initctl list \
+           | perl -ne 'print "$+{service} cluster=$+{cluster} id=$+{id}\n" if m{^(?<service>ceph-(mon|osd|mds)+)\s+\((?<cluster>[^/)]+)/(?<id>[^)]+)\) start/}' \
+           | while read l; do
+               initctl reload -- $l 2>/dev/null || :
+           done
+        done
     endscript
     missingok
 }