From: Sage Weil Date: Thu, 21 Jun 2012 19:42:53 +0000 (-0700) Subject: logrotate: reload all upstart instances X-Git-Tag: v0.48argonaut~31 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=448f5b02b10f76cc2cd93558a92d7690d60fb74b;p=ceph.git logrotate: reload all upstart instances 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 Reviewed-by: Tommi Virtanen --- diff --git a/src/logrotate.conf b/src/logrotate.conf index 3ff5d687b9f8..ba7e17666932 100644 --- a/src/logrotate.conf +++ b/src/logrotate.conf @@ -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{^(?ceph-(mon|osd|mds)+)\s+\((?[^/)]+)/(?[^)]+)\) start/}' \ + | while read l; do + initctl reload -- $l 2>/dev/null || : + done + done endscript missingok }