summaryrefslogtreecommitdiffstats
path: root/init-scripts
diff options
context:
space:
mode:
authorAdrian Likins <alikins@redhat.com>2007-09-20 16:09:20 -0400
committerAdrian Likins <alikins@redhat.com>2007-09-20 16:09:20 -0400
commit7a70b5bb80c69dafc345dfd4df577bfb1e983ee9 (patch)
tree2b3ebe15ab9c14a438b4cea2b61b31d0512450c8 /init-scripts
parent322c6fd1fe1aa02b740d646a3c02f8ec46515fa3 (diff)
downloadthird_party-func-7a70b5bb80c69dafc345dfd4df577bfb1e983ee9.zip
third_party-func-7a70b5bb80c69dafc345dfd4df577bfb1e983ee9.tar.gz
third_party-func-7a70b5bb80c69dafc345dfd4df577bfb1e983ee9.tar.xz
first pass at packaging stuff
version is 0.11-1 (this one goes to .11) "make rpms" should build a rpm from the setup.py and func.spec
Diffstat (limited to 'init-scripts')
-rwxr-xr-xinit-scripts/funcd91
1 files changed, 91 insertions, 0 deletions
diff --git a/init-scripts/funcd b/init-scripts/funcd
new file mode 100755
index 0000000..6066d99
--- /dev/null
+++ b/init-scripts/funcd
@@ -0,0 +1,91 @@
+#!/bin/sh
+#
+# funcd func api provider
+#
+# chkconfig: 345 99 99
+# description: Server to expose config, monitoring, and management apis to func
+# See https://hosted.fedoraproject.org/projects/func/
+#
+# processname: /usr/bin/funcd
+
+# Sanity checks.
+[ -x /usr/bin/funcd ] || exit 0
+
+# Source function library.
+. /etc/rc.d/init.d/functions
+
+RETVAL=0
+
+start() {
+ echo -n $"Starting the funcd : "
+ if test -f /var/lock/subsys/funcd ; then
+ echo_failure
+ echo
+ return 1
+ fi
+ /usr/bin/funcd --daemon
+ RETVAL=$?
+ echo_success
+ echo
+ touch /var/lock/subsys/funcd
+ return $RETVAL
+}
+
+
+stop() {
+ echo -n $"Stopping funcd daemon: "
+ if ! test -f /var/lock/subsys/funcd ; then
+ echo_failure
+ echo
+ return 1
+ fi
+ pkill funcd
+ RETVAL=$?
+ rm /var/lock/subsys/funcd
+ echo_success
+ echo
+ return $RETVAL
+}
+
+mystatus() {
+ if test -f /var/lock/subsys/funcd ; then
+ echo "the funcd is alive..."
+ return 0
+ fi
+ echo "we have lost the funcd"
+ echo
+ return 0
+}
+
+# See how we were called.
+case "$1" in
+ start)
+ start
+ ;;
+ stop)
+ stop
+ ;;
+ status)
+ mystatus
+ RETVAL=$?
+ ;;
+ restart)
+ stop
+ start
+ ;;
+ condrestart)
+ if [ -f /var/lock/subsys/vf_server ]; then
+ stop
+ start
+ fi
+ ;;
+ reload)
+ echo "can't reload configuration, you have to restart it"
+ RETVAL=$?
+ ;;
+ *)
+ echo $"Usage: $0 {start|stop|status|restart|condrestart|reload}"
+ ;;
+esac
+exit $RETVAL
+