#!/bin/bash # ### BEGIN INIT INFO # Provides: debuginfofs # Required-Start: $local_fs $network $named $remote_fs $syslog # Required-Stop: $local_fs $network $named $remote_fs $syslog # Short-Description: Remote debuginfo filesystem # Description: Mount a remote debuginfo filesystem for use with debugging tools ### END INIT INFO # debuginfofs This shell script takes care of mounting and unmounting the # debuginfo filesystem. # # chkconfig: - 60 50 # description: debuginfofs mounts a WebDAV share of debuginfo files at the \ # appropriate place(s) in the filesystem for use by gdb and other \ # debugging tools. # config: /etc/sysconfig/debuginfofs # Source function library. . /etc/rc.d/init.d/functions # Source networking configuration. . /etc/sysconfig/network # Source our configuration . /etc/sysconfig/debuginfofs RETVAL=0 prog="debuginfofs" start() { # Mount filesystems. # Check that networking is up. [ ${NETWORKING} = "no" ] && exit 1 # Sanity check binary and configuration [ -x /usr/bin/wdfs ] || exit 1 [ -n "$BUILDID_URL" ] || exit 1 [ -n "$BUILDID_MOUNTPOINT" ] || exit 1 [ -d "$BUILDID_MOUNTPOINT" ] || mkdir -p "$BUILDID_MOUNTPOINT" echo -n $"Starting debuginfofs: " wdfs "$BUILDID_URL" "$BUILDID_MOUNTPOINT" -o allow_other -o nonempty \ -o intr $BUILDID_ARGS RETVAL=$? [ $RETVAL -eq 0 ] && touch /var/lock/subsys/debuginfofs [ $RETVAL -eq 0 ] && success $"$prog startup" || failure $"$prog startup" echo return $RETVAL } stop() { echo -n $"Stopping debuginfofs: " fusermount -u "$BUILDID_MOUNTPOINT" RETVAL=$? rm -f /var/lock/subsys/debuginfofs [ $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) stop start RETVAL=$? ;; condrestart) if [ -f /var/lock/subsys/debuginfofs ]; then stop start RETVAL=$? fi ;; status) status $prog RETVAL=$? ;; *) echo $"Usage: $0 {start|stop|restart|condrestart|status}" exit 1 esac exit $RETVAL