From patchwork Mon Nov 26 20:26:02 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandre Oliva X-Patchwork-Id: 1806781 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 25C3840E13 for ; Mon, 26 Nov 2012 20:40:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756499Ab2KZUkZ (ORCPT ); Mon, 26 Nov 2012 15:40:25 -0500 Received: from lsd-gw.ic.unicamp.br ([143.106.7.165]:33409 "EHLO boneca.lsd.ic.unicamp.br" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1756481Ab2KZUkW (ORCPT ); Mon, 26 Nov 2012 15:40:22 -0500 X-Greylist: delayed 845 seconds by postgrey-1.27 at vger.kernel.org; Mon, 26 Nov 2012 15:40:22 EST Received: from freie (gw-to-emilia.oliva.athome.lsd.ic.unicamp.br [172.31.160.17] (may be forged)) by boneca.lsd.ic.unicamp.br (8.14.5/8.14.5) with ESMTP id qAQKQCQu027470 for ; Mon, 26 Nov 2012 18:26:12 -0200 Received: from livre.localdomain (livre-to-gw.oliva.athome.lsd.ic.unicamp.br [172.31.160.19]) by freie (8.14.5/8.14.5) with ESMTP id qAQKQBRq010019 for ; Mon, 26 Nov 2012 18:26:11 -0200 Received: from livre.localdomain (aoliva@localhost.localdomain [127.0.0.1]) by livre.localdomain (8.14.3/8.14.3/Debian-5+lenny1) with ESMTP id qAQKQ8Pb006845; Mon, 26 Nov 2012 18:26:09 -0200 Received: (from aoliva@localhost) by livre.localdomain (8.14.3/8.14.3/Submit) id qAQKQ5c9006826; Mon, 26 Nov 2012 18:26:05 -0200 X-Authentication-Warning: livre.localdomain: aoliva set sender to oliva@lsd.ic.unicamp.br using -f From: Alexandre Oliva To: ceph-devel@vger.kernel.org Subject: two trivial patches for the upcoming stable release Organization: Free thinker, not speaking for University of Campinas Date: Mon, 26 Nov 2012 18:26:02 -0200 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) MIME-Version: 1.0 Sender: ceph-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: ceph-devel@vger.kernel.org The first one was posted before, to enable out-of-tree builds; it was acked but apparently it fell through the cracks. The second fixes a regression in log rotation on systems that don't use invoke-rc.d. The which command doesn't output anything to stdout when it fails to find the requested command, and for some reason [ -x ] passes, so we end up trying to run the non-existing invoke-rc.d instead of falling back to other alternatives as intended. logrotate on systems without invoke-rc.d From: Alexandre Oliva The which command doesn't output anything to stdout when it can't find the given program name, and then [ -x ] passes. Use the exit status of which to tell whether the command exists, before testing whether it's executable, to fix it. Signed-off-by: Alexandre Oliva --- src/logrotate.conf | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/logrotate.conf b/src/logrotate.conf index aef3572..97d4fcd 100644 --- a/src/logrotate.conf +++ b/src/logrotate.conf @@ -4,11 +4,11 @@ compress sharedscripts postrotate - if [ -x `which invoke-rc.d` ]; then + if which invoke-rc.d && [ -x `which invoke-rc.d` ]; then invoke-rc.d ceph reload >/dev/null - elif [ -x `which service` ]; then + elif which service && [ -x `which service` ]; then service ceph reload >/dev/null - elif [ -x `which initctl` ]; then + elif which initctl && [ -x `which initctl` ]; then # upstart reload isn't very helpful here: # https://bugs.launchpad.net/upstart/+bug/1012938 for type in mon osd mds; do