#! /bin/sh # # fuse Init script for Filesystem in Userspace # # Author: Miklos Szeredi <miklos@szeredi.hu> # # chkconfig: 345 26 76 # description: Filesystem in Userspace # ### BEGIN INIT INFO # Provides: $remote_fs # Required-Start: dkms $network # Required-Stop: dkms $network # Default-Start: 3 4 5 # Short-Description: Init script for Filesystem in Userspace. # Description: Init script for Filesystem in Userspace. ### END INIT INFO [ -r /etc/sysconfig/network ] || exit 0 . /etc/sysconfig/network # Check that networking is up. [ "${NETWORKING}" = "no" ] && exit 0 [ -r /etc/init.d/functions ] || exit 0 . /etc/init.d/functions MOUNTPOINT=/sys/fs/fuse/connections # Gracefully exit if the package has been removed. test -x /usr/bin/fusermount || exit 0 case "$1" in start) gprintf "Starting fuse: " if ! /bin/grep -qw fuse /proc/filesystems; then /sbin/modprobe fuse >/dev/null 2>&1 fi if /bin/grep -qw fusectl /proc/filesystems && \ ! /bin/grep -qw $MOUNTPOINT /proc/mounts; then /bin/mount -t fusectl none $MOUNTPOINT >/dev/null 2>&1 fi RETVAL=$? [ $RETVAL -eq 0 ] && success || failure echo [ $RETVAL -eq 0 ] && /bin/touch /var/lock/subsys/fuse ;; stop) gprintf "Stopping fuse: " if /bin/grep -qw $MOUNTPOINT /proc/mounts; then /bin/umount $MOUNTPOINT >/dev/null 2>&1 fi if /bin/grep -qw "^fuse" /proc/modules; then /sbin/rmmod fuse >/dev/null 2>&1 fi RETVAL=$? [ $RETVAL -eq 0 ] && success || failure echo [ $RETVAL -eq 0 ] && /bin/rm -f /var/lock/subsys/fuse ;; restart) $0 stop $0 start ;; reload) $0 start ;; status) if [ -e /var/lock/subsys/fuse ]; then echo "fuse is running" else echo "fuse is not running" fi if /bin/grep -qw fuse /proc/filesystems; then echo "fuse filesystem is supported" else echo "fuse filesystem is not supported" fi if /bin/grep -qw fusectl /proc/filesystems; then echo "fusectl filesystem is supported" else echo "fusectl filesystem is not supported" fi if /bin/grep -qw $MOUNTPOINT /proc/mounts; then echo "mount point $MOUNTPOINT exists" else echo "mount point $MOUNTPOINT does not exist" fi ;; *) gprintf "Usage: %s\n" "$(basename $0) {start|stop|restart|reload|status}" exit 1 esac exit 0