From patchwork Fri Sep 21 14:43:03 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 1491841 X-Patchwork-Delegate: alexne@voltaire.com Return-Path: X-Original-To: patchwork-linux-rdma@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 435C43FE65 for ; Fri, 21 Sep 2012 14:43:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754880Ab2IUOnP (ORCPT ); Fri, 21 Sep 2012 10:43:15 -0400 Received: from [178.239.52.149] ([178.239.52.149]:40716 "EHLO wimaserver10.be" rhost-flags-FAIL-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1754515Ab2IUOnP (ORCPT ); Fri, 21 Sep 2012 10:43:15 -0400 Received: from 178-119-64-133.access.telenet.be ([178.119.64.133] helo=[192.168.1.100]) by wimaserver10.be with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.72) (envelope-from ) id 1TF4YF-0005rc-9L; Fri, 21 Sep 2012 16:49:55 +0200 Message-ID: <505C7CF7.8010804@acm.org> Date: Fri, 21 Sep 2012 16:43:03 +0200 From: Bart Van Assche User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:15.0) Gecko/20120825 Thunderbird/15.0 MIME-Version: 1.0 To: Alex Netes CC: "linux-rdma@vger.kernel.org" , Doug Ledford Subject: [PATCH 2/4 for opensm] Make it possible to enable opensm with chkconfig Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org "chkconfig $service on" enables a service in the runlevels mentioned next to "Default-Start" and only in those runlevels. Signed-off-by: Bart Van Assche Cc: Doug Ledford --- configure.in | 10 ++++++++++ scripts/opensm.init.in | 4 ++-- scripts/redhat-opensm.init.in | 3 +++ 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/configure.in b/configure.in index eb252ff..f660a5b 100644 --- a/configure.in +++ b/configure.in @@ -11,6 +11,16 @@ AM_INIT_AUTOMAKE AC_SUBST(RELEASE, ${RELEASE:-unknown}) AC_SUBST(TARBALL, ${TARBALL:-${PACKAGE}-${VERSION}.tar.gz}) +if { rpm -q sles-release || rpm -q openSUSE-release; } >/dev/null 2>&1; then + default_start="2 3 5" + default_stop="0 1 4 6" +else + default_start="2 3 4 5" + default_stop="0 1 6" +fi +AC_SUBST(DEFAULT_START, $default_start) +AC_SUBST(DEFAULT_STOP, $default_stop) + dnl NOTE: AC_DEFINE's and AC_DEFINE_UNQUOTED's which are used in header files dnl MUST have a corresponding entry in include/opensm/osm_config.h.in to dnl ensure plugin compatibility. diff --git a/scripts/opensm.init.in b/scripts/opensm.init.in index 0c84bd3..007dae4 100644 --- a/scripts/opensm.init.in +++ b/scripts/opensm.init.in @@ -9,8 +9,8 @@ # Provides: opensm # Required-Start: $syslog # Required-Stop: -# Default-Start: none -# Default-Stop: 0 1 6 +# Default-Start: @DEFAULT_START@ +# Default-Stop: @DEFAULT_STOP@ # Description: Manage OpenSM ### END INIT INFO # diff --git a/scripts/redhat-opensm.init.in b/scripts/redhat-opensm.init.in index 9c22275..bea0f0d 100755 --- a/scripts/redhat-opensm.init.in +++ b/scripts/redhat-opensm.init.in @@ -7,6 +7,9 @@ # ### BEGIN INIT INFO # Provides: opensm +# Default-Start: @DEFAULT_START@ +# Default-Stop: @DEFAULT_STOP@ +# Description: Manage OpenSM ### END INIT INFO # # Copyright (c) 2008 Voltaire, Inc. All rights reserved.