aboutsummaryrefslogtreecommitdiffstats
path: root/meta-oe/recipes-support/openwbem/openwbem/openwbem-owcimomd.init
diff options
context:
space:
mode:
authorLi xin <lixin.fnst@cn.fujitsu.com>2014-12-12 13:15:32 +0800
committerMartin Jansa <Martin.Jansa@gmail.com>2014-12-19 20:10:56 +0100
commite2f8425e2d806e511489694ec338c6299eddcddd (patch)
treec9fd885f37dc86bfa48d97a5143db5ef4e01318f /meta-oe/recipes-support/openwbem/openwbem/openwbem-owcimomd.init
parent6781f9b5dc60bbd39727aeaa74c13dd31eb73838 (diff)
downloadmeta-openembedded-contrib-e2f8425e2d806e511489694ec338c6299eddcddd.tar.gz
openwbem: add new recipe
OpenWBEM is a set of software components that help facilitate deployment of the Common Information Model (CIM) and Web-Based Enterprise Management (WBEM) technologies of the Distributed Management Task Force (DMTF). Signed-off-by: Li Xin <lixin.fnst@cn.fujitsu.com> Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Diffstat (limited to 'meta-oe/recipes-support/openwbem/openwbem/openwbem-owcimomd.init')
-rw-r--r--meta-oe/recipes-support/openwbem/openwbem/openwbem-owcimomd.init131
1 files changed, 131 insertions, 0 deletions
diff --git a/meta-oe/recipes-support/openwbem/openwbem/openwbem-owcimomd.init b/meta-oe/recipes-support/openwbem/openwbem/openwbem-owcimomd.init
new file mode 100644
index 0000000000..47fa8a7c67
--- /dev/null
+++ b/meta-oe/recipes-support/openwbem/openwbem/openwbem-owcimomd.init
@@ -0,0 +1,131 @@
+#!/bin/sh
+#
+### BEGIN INIT INFO
+# Provides: owcimomd
+# Required-Start: $network
+# Required-Stop: $network
+# Default-Start: 2 3 4 5
+# Default-Stop: 0 1 6
+# Short-Description: OpenWBEM CIMOM Daemon
+# Description: owcimomd
+# Start/Stop the OpenWBEM CIMOM Daemon
+### END INIT INFO
+#
+#
+# chkconfig: 2345 36 64
+# description: OpenWBEM CIMOM Daemon
+# processname: owcimomd
+
+NAME=owcimomd
+DAEMON=/usr/sbin/$NAME
+OPTIONS=
+PIDFILE=/var/run/$NAME.pid
+
+if [ $EUID != 0 ]; then
+ echo "This script must be run as root."
+ exit 1;
+fi
+
+if [ "$DESCRIPTIVE" = "" ]; then
+ DESCRIPTIVE="OpenWBEM CIMOM Daemon"
+fi
+
+lockfile=${SVIlock:-/var/lock/subsys/$NAME}
+
+[ -x $DAEMON ] || exit 0
+
+# See how we were called.
+. /etc/init.d/functions
+
+start() {
+ if [ ! -f "/etc/openwbem/serverkey.pem" ]; then
+ if [ -f "/etc/ssl/servercerts/servercert.pem" \
+ -a -f "/etc/ssl/servercerts/serverkey.pem" ]; then
+ echo "Using common server certificate /etc/ssl/servercerts/servercert.pem"
+ ln -s /etc/ssl/servercerts/server{cert,key}.pem /etc/openwbem/
+ else
+ echo "Generating OpenWBEM server public certificate and private key"
+ FQDN=`hostname --fqdn`
+ if [ "x${FQDN}" = "x" ]; then
+ FQDN=localhost.localdomain
+ fi
+cat << EOF | sh /etc/openwbem/owgencert > /dev/null 2>&1
+--
+SomeState
+SomeCity
+SomeOrganization
+SomeOrganizationalUnit
+${FQDN}
+root@${FQDN}
+EOF
+ fi
+ fi
+
+ # Start daemons.
+ echo -n "Starting the $DESCRIPTIVE"
+ daemon $DAEMON $OPTIONS > /dev/null 2>&1
+ RETVAL=$?
+
+ if [ $RETVAL -eq 0 ]; then
+ touch $lockfile
+ success
+ fi
+
+ echo
+ return $RETVAL
+}
+
+stop() {
+ # Stop daemons.
+ echo -n "Shutting down $DESCRIPTIVE"
+ killproc $DAEMON
+ RETVAL=$?
+
+ if [ $RETVAL -eq 0 ]; then
+ rm -f $lockfile
+ success
+ else
+ failure
+ fi
+ echo
+ return $RETVAL
+}
+
+restart() {
+ stop
+ start
+}
+
+case "$1" in
+ start)
+ start
+ ;;
+
+ stop)
+ stop
+ ;;
+
+ restart|force-reload)
+ restart
+ ;;
+
+ reload)
+ echo -n "Reload service $DESCRIPTIVE"
+ killproc -p $PIDFILE -HUP $DAEMON
+ RETVAL=$?
+ echo
+ exit $RETVAL
+ ;;
+
+ status)
+ echo -n "Checking for service $DESCRIPTIVE"
+ status $DAEMON
+ RETVAL=$?
+ exit $RETVAL
+ ;;
+
+ *)
+ echo "Usage: $0 {restart|start|stop|reload|force-reload|status}"
+esac
+
+exit $RETVAL