diff mbox

[6/6] opensm: /etc/init.d/opensmd: Port to Debian

Message ID 504F48DA.3030400@acm.org (mailing list archive)
State Rejected
Delegated to: Alex Netes
Headers show

Commit Message

Bart Van Assche Sept. 11, 2012, 2:21 p.m. UTC
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
---
 scripts/opensm.init.in |   12 +++++++++---
 1 files changed, 9 insertions(+), 3 deletions(-)

Comments

Bart Van Assche Sept. 14, 2012, 4:05 p.m. UTC | #1
On 09/11/12 16:21, Bart Van Assche wrote:
> [ ... ]

Please drop this patch - I'll send a reworked patch shortly.

Bart.
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

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