From patchwork Tue Sep 11 14:21:14 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: 1438321 X-Patchwork-Delegate: alexne@voltaire.com Return-Path: X-Original-To: patchwork-linux-rdma@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 2F68BDFAF3 for ; Tue, 11 Sep 2012 14:21:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758432Ab2IKOVQ (ORCPT ); Tue, 11 Sep 2012 10:21:16 -0400 Received: from juliette.telenet-ops.be ([195.130.137.74]:42557 "EHLO juliette.telenet-ops.be" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754149Ab2IKOVP (ORCPT ); Tue, 11 Sep 2012 10:21:15 -0400 Received: from [192.168.1.101] ([178.119.64.133]) by juliette.telenet-ops.be with bizsmtp id xqME1j00T2sVyXE06qME12; Tue, 11 Sep 2012 16:21:14 +0200 Message-ID: <504F48DA.3030400@acm.org> Date: Tue, 11 Sep 2012 16:21:14 +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: "linux-rdma@vger.kernel.org" CC: Alex Netes Subject: [PATCH 6/6] opensm: /etc/init.d/opensmd: Port to Debian X-Enigmail-Version: 1.4.4 Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org Signed-off-by: Bart Van Assche --- scripts/opensm.init.in | 12 +++++++++--- 1 files changed, 9 insertions(+), 3 deletions(-) diff --git a/scripts/opensm.init.in b/scripts/opensm.init.in index 01d2bb9..1b9348c 100644 --- a/scripts/opensm.init.in +++ b/scripts/opensm.init.in @@ -45,14 +45,20 @@ exec_prefix=@exec_prefix@ # Source function library. if [[ -s /etc/init.d/functions ]]; then + # RHEL / Fedora. . /etc/init.d/functions rc_status() { :; } rc_exit() { exit $RETVAL; } -fi -if [[ -s /etc/rc.status ]]; then +elif [[ -s /etc/rc.status ]]; then . /etc/rc.status failure() { rc_status -v; } success() { rc_status -v; } +elif [[ -s /lib/lsb/init-functions ]]; then + # SLES / openSuSE / Debian. + . /lib/lsb/init-functions + rc_exit() { exit $RETVAL; } + failure() { log_failure_msg; } + success() { log_success_msg; } fi CONFIG=@sysconfdir@/sysconfig/opensm @@ -62,7 +68,7 @@ fi start () { echo -n "Starting opensm: " - @sbindir@/opensm --daemon $OPTIONS > /dev/null + @sbindir@/opensm --daemon --pidfile /var/run/opensm.pid $OPTIONS > /dev/null if [[ $RETVAL -eq 0 ]]; then touch /var/lock/subsys/opensm success