if ENABLE_FUSE
if ENABLE_SBIN_MOUNT
mount_captive_cond=mount.captive
+initd_SCRIPTS_cond=captive
install-exec-hook:
$(mkinstalldirs) $(DESTDIR)$(enable_sbin_mountdir)
endif
endif
man_MANS=$(mount_captive_man_cond)
+
+initddir=$(sysconfdir)/init.d
+initd_SCRIPTS=$(captive_cond)
+EXTRA_DIST+=captive.init
+CLEANFILES+=captive
+captive: captive.init
+ $(LN_S) $< $@
+
--- /dev/null
+#! /bin/bash
+#
+# captive Start/Stop the cron clock daemon.
+#
+# chkconfig: 2345 99 01
+# description: Captive allows applications running under the GNU/Linux
+# operating system to access NTFS drives. File system driver
+# compatibility with VFAT, ISO9660 and EXT2 is also provided.
+
+# Source function library.
+. /etc/init.d/functions
+
+# Never drop this lock - we need to catch manually mounts on system shutdown.
+touch /var/lock/subsys/captive
+
+
+start() {
+ # In fact this part is done during the boot anyway.
+ grep -q '\<captive-.*\<auto\>' /etc/fstab || return
+
+ fses="$(echo /sbin/mount.captive-*|sed 's#/sbin/mount[.]##g'|tr ' ' ,)"
+ if [ -z "$fses" ]; then
+ return
+ fi
+ action $"Mounting captive filesystems: " mount -a -t "$fses"
+ RETVAL=$?
+ echo
+ return $RETVAL
+}
+
+stop() {
+ # I did not find any way how to identify (or even mark) "captive-*"
+ # filesystems between the mounted ones.
+ # Devicename really must be set to the real devicename as otherwise
+ # mount(8) would try to mount "captive-*" twice during boot.
+ action $"Unmounting captive (FUSE) filesystems: " umount -a -t fuse
+ RETVAL=$?
+ return $RETVAL
+}
+
+restart() {
+ stop
+ start
+}
+
+case "$1" in
+ start)
+ start
+ ;;
+ stop)
+ stop
+ ;;
+ restart)
+ restart
+ ;;
+ *)
+ echo $"Usage: $0 {start|stop|restart}"
+ exit 1
+esac