summaryrefslogtreecommitdiffstats
path: root/icegridnode.init
diff options
context:
space:
mode:
authorRemi Collet <fedora@famillecollet.com>2011-12-28 07:44:11 +0100
committerRemi Collet <fedora@famillecollet.com>2011-12-28 07:44:11 +0100
commit02e36a99a9739e660a17243fc442380284a81d99 (patch)
tree4a6c0be04616519a0c642e658277aa43bd15b666 /icegridnode.init
ice: import from f16
Diffstat (limited to 'icegridnode.init')
-rw-r--r--icegridnode.init111
1 files changed, 111 insertions, 0 deletions
diff --git a/icegridnode.init b/icegridnode.init
new file mode 100644
index 0000000..f400d11
--- /dev/null
+++ b/icegridnode.init
@@ -0,0 +1,111 @@
+#!/bin/bash
+#
+# Copyright (c) 2007-2010 ZeroC, Inc. All rights reserved.
+#
+# icegridnode This shell script takes care of starting and
+# stopping the icegridnode daemon.
+#
+# chkconfig: - 61 75
+# description: The IceGrid node daemon. \
+# IceGrid is the server deployment and monitoring for the Internet \
+# Communications Engine (Ice). An IceGrid domain consists of one master \
+# registry, zero or more slave registries, and zero or more IceGrid nodes.
+
+#
+# Source function library.
+#
+. /etc/init.d/functions
+
+#
+# The IceGrid node user; root is allowed, but not necessary, therefore
+# it is recommended to use a non-root account.
+#
+user=iceuser
+
+#
+# Ask for a password at startup?
+#
+prompt=no
+
+#
+# The IceGrid node configuration file
+#
+nodeconf="/etc/icegridnode.conf"
+
+prog="/usr/bin/icegridnode"
+
+progbase=${prog##*/}
+pidfile=/var/run/$progbase.pid
+
+options="--daemon --pidfile $pidfile --Ice.Config=$nodeconf"
+
+RETVAL=0
+
+start() {
+ if [ "${prompt:-}" = "yes" ]
+ then
+ echo $"Starting $progbase: "
+ INITLOG_ARGS= # clears -q
+ else
+ echo -n $"Starting $progbase: "
+ fi
+
+ daemonoptions="--pidfile $pidfile"
+ if [ "$user" != "root" ]
+ then
+ daemonoptions="$daemonoptions --user $user"
+
+ if [ ! -e $pidfile ]
+ then
+ touch $pidfile
+ fi
+ chown $user $pidfile
+ fi
+
+ daemon $daemonoptions $prog $options
+ RETVAL=$?
+ echo
+ [ $RETVAL -eq 0 ] && touch /var/lock/subsys/$progbase
+ return $RETVAL
+}
+
+stop() {
+ echo -n $"Shutting down $progbase: "
+ killproc -p $pidfile $prog
+ RETVAL=$?
+ echo
+ [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/$progbase
+ return $RETVAL
+}
+
+
+# See how we were called.
+case "$1" in
+ start)
+ start
+ ;;
+ stop)
+ stop
+ ;;
+ status)
+ status $progbase
+ RETVAL=$?
+ ;;
+ restart|reload)
+ stop
+ start
+ RETVAL=$?
+ ;;
+ condrestart)
+ if [ -f /var/lock/subsys/$progbase ]; then
+ stop
+ start
+ RETVAL=$?
+ fi
+ ;;
+ *)
+ echo $"Usage: $0 {start|stop|restart|condrestart|status}"
+ exit 1
+esac
+
+exit $RETVAL