summaryrefslogtreecommitdiffstats
path: root/server/debuginfofs-server.init
diff options
context:
space:
mode:
Diffstat (limited to 'server/debuginfofs-server.init')
-rwxr-xr-xserver/debuginfofs-server.init89
1 files changed, 89 insertions, 0 deletions
diff --git a/server/debuginfofs-server.init b/server/debuginfofs-server.init
new file mode 100755
index 0000000..ac294bc
--- /dev/null
+++ b/server/debuginfofs-server.init
@@ -0,0 +1,89 @@
+#!/bin/bash
+#
+### BEGIN INIT INFO
+# Provides: debuginfofs-server
+# Required-Start: $local_fs $network $named $remote_fs $syslog
+# Required-Stop: $local_fs $network $named $remote_fs $syslog
+# Short-Description: Remote debuginfo filesystem server
+# Description: Export a filesystem with debuginfo for use with debugging tools
+### END INIT INFO
+
+# debuginfofs Starts/stops the debuginfofs WebDAV server
+#
+# chkconfig: - 85 15
+# description: debuginfofs-server starts a WebDAV server which exports the \
+# debuginfo data fetched with debuginfofs-mirror.
+# config: /etc/debuginfofs.conf
+
+# Source function library.
+. /etc/rc.d/init.d/functions
+
+# Source networking configuration.
+. /etc/sysconfig/network
+
+# Read our configuration
+export DEBUGINFOFS_EXPORTDIR="$(sed -ne 's/ *exportdir *=\(.*\)$/\1/p' /etc/debuginfofs.conf 2>/dev/null)"
+
+RETVAL=0
+prog="debuginfofs-server"
+pidfile="/var/run/$prog.pid"
+
+start() {
+ # Check that networking is up.
+ [ ${NETWORKING} = "no" ] && exit 1
+
+ # Sanity check binary and configuration
+ [ -x /usr/sbin/httpd ] || exit 1
+ [ -d "$DEBUGINFOFS_EXPORTDIR" ] || mkdir -p "$DEBUGINFOFS_EXPORTDIR"
+ [ -r "$DEBUGINFOFS_EXPORTDIR" ] || exit 1
+
+ echo -n $"Starting debuginfofs-server: "
+ /usr/sbin/httpd -f /usr/share/debuginfofs/dav-debuginfo.conf
+ RETVAL=$?
+
+ [ $RETVAL -eq 0 ] && touch /var/lock/subsys/debuginfofs-server
+ [ $RETVAL -eq 0 ] && success $"$prog startup" || failure $"$prog startup"
+ echo
+ return $RETVAL
+}
+
+stop() {
+ echo -n $"Stopping debuginfofs: "
+ /usr/sbin/httpd -f /usr/share/debuginfofs/dav-debuginfo.conf -k stop
+ RETVAL=$?
+ rm -f /var/lock/subsys/debuginfofs-server
+ [ $RETVAL -eq 0 ] && success $"$prog shutdown" || failure $"$prog shutdown"
+ echo
+ return $RETVAL
+}
+
+# See how we were called.
+case "$1" in
+ start)
+ start
+ ;;
+ stop)
+ stop
+ ;;
+ restart|reload|force-reload)
+ stop
+ start
+ RETVAL=$?
+ ;;
+ condrestart)
+ if [ -f /var/lock/subsys/debuginfofs-server ]; then
+ stop
+ start
+ RETVAL=$?
+ fi
+ ;;
+ status)
+ status $prog
+ RETVAL=$?
+ ;;
+ *)
+ echo $"Usage: $0 {start|stop|restart|condrestart|status}"
+ exit 1
+esac
+
+exit $RETVAL