3 # opensm: Manage OpenSM
6 # description: Manage OpenSM
10 # Required-Start: $syslog
13 # Description: Manage OpenSM
16 # Copyright (c) 2008 Voltaire, Inc. All rights reserved.
17 # Copyright 2006 PathScale, Inc. All Rights Reserved.
19 # This Software is licensed under one of the following licenses:
21 # 1) under the terms of the "Common Public License 1.0" a copy of which is
22 # available from the Open Source Initiative, see
23 # http://www.opensource.org/licenses/cpl.php.
25 # 2) under the terms of the "The BSD License" a copy of which is
26 # available from the Open Source Initiative, see
27 # http://www.opensource.org/licenses/bsd-license.php.
29 # 3) under the terms of the "GNU General Public License (GPL) Version 2" a
30 # copy of which is available from the Open Source Initiative, see
31 # http://www.opensource.org/licenses/gpl-license.php.
33 # Licensee has the right to choose one of the above licenses.
35 # Redistributions of source code must retain the above copyright
36 # notice and one of the license notices.
38 # Redistributions in binary form must reproduce both the above copyright
39 # notice, one of the license notices in the documentation
40 # and/or other materials provided with the distribution.
43 exec_prefix=@exec_prefix@
45 # Source function library.
46 if [[ -s /etc/init.d/functions ]]; then
47 . /etc/init.d/functions
49 rc_exit() { exit $RETVAL; }
51 if [[ -s /etc/rc.status ]]; then
53 failure() { rc_status -v; }
54 success() { rc_status -v; }
57 CONFIG=@sysconfdir@/sysconfig/opensm
58 if [[ -s $CONFIG ]]; then
63 echo -n "Starting opensm: "
64 @sbindir@/opensm --daemon $OPTIONS > /dev/null
65 if [[ $RETVAL -eq 0 ]]; then
66 touch /var/lock/subsys/opensm
75 echo -n "Shutting down opensm: "
77 if [[ $RETVAL -eq 0 ]]; then
78 rm -f /var/lock/subsys/opensm
89 if [ $ret -eq 0 ] ; then
90 echo "OpenSM is running... pid=$pid"
92 echo "OpenSM is not running."
101 # See how we were called.
112 restart | force-reload | reload)
115 try-restart | condrestart)
116 [ -e /var/lock/subsys/opensm ] && restart
127 echo $"Usage: $0 {start|stop|status|restart|reload|condrestart|resweep|rotatelog}"
132 _rc_status_all=$RETVAL