From patchwork Tue Feb 5 01:35:50 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gary Lowell X-Patchwork-Id: 2095831 Return-Path: X-Original-To: patchwork-ceph-devel@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id AB9CA3FC23 for ; Tue, 5 Feb 2013 01:36:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754649Ab3BEBf4 (ORCPT ); Mon, 4 Feb 2013 20:35:56 -0500 Received: from mail-da0-f43.google.com ([209.85.210.43]:62116 "EHLO mail-da0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754474Ab3BEBfz convert rfc822-to-8bit (ORCPT ); Mon, 4 Feb 2013 20:35:55 -0500 Received: by mail-da0-f43.google.com with SMTP id u36so2888952dak.16 for ; Mon, 04 Feb 2013 17:35:54 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:from:content-type:content-transfer-encoding:subject:date :message-id:to:mime-version:x-mailer:x-gm-message-state; bh=p9UmgHGHfLNTRv+/gDDlRVXlVSvtutN1ufWkL2RLMfI=; b=SBy38KNTTKM2aRFNi0YeRmhPufiCrUOyD4UAD8siVto+dioevt/xwnS9GcTRw/AZ3z im12epLb0kUmltXURzuk9uHrZ6o7Y2bFYSqtlPcpDo/YRZ3bNWGxllz12z+2BM7LPigT NkOeZDqeDVICDr194OCNaV+DaXgRjmz9msq5IrrjOlo8me0ET/tKY/jbxAZw+Onctro9 yInyLKB9YFGVG0666HnbHCr+BetmQ4pw0OfQuel8JDXH+I8M05aMl7BEwibStlcmi5yA MigPgSLS8mougsJAb+iMFHgv9lVUb67AdgTkuKHejXGkcTl538iTzrDAO0xCPa0HaNy4 wFXQ== X-Received: by 10.66.9.2 with SMTP id v2mr58562699paa.18.1360028154758; Mon, 04 Feb 2013 17:35:54 -0800 (PST) Received: from [192.168.1.183] (c-98-210-224-250.hsd1.ca.comcast.net. [98.210.224.250]) by mx.google.com with ESMTPS id l8sm25175481pax.9.2013.02.04.17.35.52 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 04 Feb 2013 17:35:53 -0800 (PST) From: Gary Lowell Subject: Review request branch wip-3768 remove perl dependency Date: Mon, 4 Feb 2013 17:35:50 -0800 Message-Id: To: Ceph Development Mime-Version: 1.0 (Apple Message framework v1283) X-Mailer: Apple Mail (2.1283) X-Gm-Message-State: ALoCoQlSvbor+dNJBzCKOnNEiRGH14XTfhCxpCn9lGBvJhw0UT4RO2kMqpbbJdwSxZNuV6b/bAL6 Sender: ceph-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: ceph-devel@vger.kernel.org Hi - This is a relatively small change but involves changing a perl regex to sed: I'd really appreciate any feedback on the new sed regex. Also, I suspect that the for loop is not needed any longer since type is unused. Thanks Gary --- To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/src/logrotate.conf b/src/logrotate.conf index 9af3104..0a4a5a2 100644 --- a/src/logrotate.conf +++ b/src/logrotate.conf @@ -15,7 +15,7 @@ # 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/}' \ + | sed -n 's/^\(ceph-\(mon\|osd\|mds\)\+\)[ \t]\+(\([^ \/]\+\)\/\([^ \/]\+\))[ \t]\+start\/.*$/\1 cluster=\3 id=\4/p' \ | while read l; do initctl reload -- $l 2>/dev/null || :