Skip to contentSkip to conversation

Make it possible to enable opensm with chkconfig

PATCH In review Bart Van Assche 2 participants 3 messages Sep 21, 2012 – Oct 24, 2012 1 message not in the archive InfiniBand

lore
Share & tools
lore
#0 lore raw

PATCH 2/4 Make it possible to enable opensm with chkconfig

"chkconfig $service on" enables a service in the runlevels mentioned next to "Default-Start" and only in those runlevels.

---
 configure.in                  |   10 ++++++++++
 scripts/opensm.init.in        |    4 ++--
 scripts/redhat-opensm.init.in |    3 +++
 3 files changed, 15 insertions(+), 2 deletions(-)
configure.in +10 -0
index eb252ff..f660a5b 100644
@@ -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.
scripts/opensm.init.in +2 -2
index 0c84bd3..007dae4 100644
@@ -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
 #
scripts/redhat-opensm.init.in +3 -0
index 9c22275..bea0f0d 100755
@@ -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.
Signature · 6 lines
1.7.10.4

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

A message that is not in the archive (sent off-list or not yet received): [email protected]

#2 lore raw

Hi Bart,

Quoted 19 lines · Bart Van Assche

"chkconfig $service on" enables a service in the runlevels mentioned next to "Default-Start" and only in those runlevels.

---
 configure.in                  |   10 ++++++++++
 scripts/opensm.init.in        |    4 ++--
 scripts/redhat-opensm.init.in |    3 +++
 3 files changed, 15 insertions(+), 2 deletions(-)
configure.in +0 -0
index eb252ff..f660a5b 100644
@@ -11,6 +11,16 @@ AM_INIT_AUTOMAKE
 AC_SUBST(RELEASE, ${RELEASE:-unknown})
 AC_SUBST(TARBALL, ${TARBALL:-${PACKAGE}-${VERSION}.tar.gz})
 

configure.in AM_INIT_AUTOMAKE · line 23

Quoted 10 lines
configure.in +10 -0
+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)
+

Can you please elaborate more why there is a difference with runlevels selection between SUSE and RH?

-- Alex
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

#3 lore raw
Quoted 22 lines · Alex Netes

Hi Bart,

Quoted 19 lines · Bart Van Assche

"chkconfig $service on" enables a service in the runlevels mentioned next to "Default-Start" and only in those runlevels.

---
  configure.in                  |   10 ++++++++++
  scripts/opensm.init.in        |    4 ++--
  scripts/redhat-opensm.init.in |    3 +++
  3 files changed, 15 insertions(+), 2 deletions(-)
configure.in +0 -0
index eb252ff..f660a5b 100644
@@ -11,6 +11,16 @@ AM_INIT_AUTOMAKE
  AC_SUBST(RELEASE, ${RELEASE:-unknown})
  AC_SUBST(TARBALL, ${TARBALL:-${PACKAGE}-${VERSION}.tar.gz})
 
Quoted 13 lines

configure.in AM_INIT_AUTOMAKE · line 23

Quoted 10 lines
configure.in +10 -0
+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)
+

Can you please elaborate more why there is a difference with runlevels selection between SUSE and RH?

Most services in SLES and openSUSE, including syslog, are enabled in runlevels 2, 3 and 5 but not in runlevel 4. RHEL systems however follow the LFS and have services like syslog enabled in runlevels 2, 3, 4 and 5. One of the patches I posted adds $syslog to the list of services that must be started before opensm is started. If the Default-Start runlevels specified in /etc/init.d/opensm do not match the runlevels in which syslog is started then chkconfig prints a warning when enabling the opensm service. Hence the above code to make the Default-Start runlevels of opensm match the Default-Start runlevels of syslog.

Bart.

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html