OK, thanks for the info.
Here are sum new initscripts that hopefully will work:
-----------------------------------------
root@karen: ~ #
cat /etc/init.d/zfs
#! /bin/sh
### BEGIN INIT INFO
# Provides: zfs
# Required-Start: mountall
# Required-Stop: sendsigs
# Should-Start:
# Should-Stop:
# Default-Start:
# Default-Stop:
# Short-Description: Enable/disable the ZFS-FUSE subsystem
# Description: Control ZFS-FUSE subsystem
### END INIT INFO
PIDFILE=/var/run/zfs-fuse.pid
LOCKFILE=/var/lock/zfs/zfs_lock
PATH=/sbin:/bin:/usr/bin
. /lib/init/vars.sh
. /lib/lsb/init-functions
. /lib/init/mount-functions.sh
if [ -r /etc/default/locale ]; then
. /etc/default/locale
export LANG
fi
do_start() {
test -x /sbin/zfs-fuse || exit 0
PID=`cat "$PIDFILE" 2> /dev/null`
if [ "$PID" != "" ]
then
if kill -0 $PID
then
echo "ZFS-FUSE is already running"
exit 3
else
# pid file is stale, we clean up shit
log_action_begin_msg "Cleaning up stale ZFS-
FUSE PID files"
rm -f /var/run/sendsigs.omit.d/zfs-fuse
"$PIDFILE"
log_action_end_msg 0
fi
fi
pre_mountall
log_action_begin_msg "Starting ZFS-FUSE process"
ulimit -v unlimited
zfs-fuse -p "$PIDFILE"
ES_TO_REPORT=$?
if [ 0 = "$ES_TO_REPORT" ]
then
log_action_end_msg 0
else
log_action_end_msg 1 "code $ES_TO_REPORT"
post_mountall
exit 3
fi
for a in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
do
PID=`cat "$PIDFILE"`
[ "$PID" != "" ] && break
sleep 1
done
if [ "$PID" = "" ]
then
log_action_end_msg 1 "ZFS-FUSE did not start or create
$PIDFILE"
post_mountall
exit 3
else
log_action_end_msg 0
fi
log_action_begin_msg "Immunizing ZFS-FUSE against OOM kills
and sendsigs signals"
cp "$PIDFILE" /var/run/sendsigs.omit.d/zfs-fuse
echo -17 > "/proc/$PID/oom_adj"
ES_TO_REPORT=$?
if [ 0 = "$ES_TO_REPORT" ]
then
log_action_end_msg 0
else
log_action_end_msg 1 "code $ES_TO_REPORT"
post_mountall
exit 3
fi
log_action_begin_msg "Mounting ZFS filesystems"
zfs mount -a
ES_TO_REPORT=$?
if [ 0 = "$ES_TO_REPORT" ]
then
log_action_end_msg 0
else
log_action_end_msg 1 "code $ES_TO_REPORT"
post_mountall
exit 3
fi
log_action_begin_msg "Increasing ZFS-FUSE priority"
renice -15 -g $PID > /dev/null
ES_TO_REPORT=$?
if [ 0 = "$ES_TO_REPORT" ]
then
log_action_end_msg 0
else
log_action_end_msg 1 "code $ES_TO_REPORT"
post_mountall
exit 3
fi
post_mountall
}
do_stop () {
test -x /sbin/zfs-fuse || exit 0
PID=`cat "$PIDFILE" 2> /dev/null`
if [ "$PID" = "" ] ; then
# no pid file, we exit
exit 0
elif kill -0 $PID 2> /dev/null; then
# pid file and killable, we continue
true
else
# pid file is stale, we clean up shit
log_action_begin_msg "Cleaning up stale ZFS-FUSE PID
files"
rm -f /var/run/sendsigs.omit.d/zfs-fuse "$PIDFILE"
log_action_end_msg 0
exit 0
fi
pre_mountall
log_action_begin_msg "Syncing disks"
sync
log_action_end_msg 0
log_action_begin_msg "Unmounting ZFS filesystems"
zfs unmount -a
ES_TO_REPORT=$?
if [ 0 = "$ES_TO_REPORT" ]
then
log_action_end_msg 0
else
log_action_end_msg 1 "code $ES_TO_REPORT"
post_mountall
exit 3
fi
post_mountall # restore /var/lock and /var/run to their right
places
log_action_begin_msg "Terminating ZFS-FUSE process gracefully"
kill -TERM $PID
for a in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
do
kill -0 $PID 2> /dev/null
[ "$?" != "0" ] && break
sleep 1
done
if kill -0 $PID 2> /dev/null
then
log_action_end_msg 1 "ZFS-FUSE refused to die after 15
seconds"
post_mountall
exit 3
else
rm -f /var/run/sendsigs.omit.d/zfs-fuse "$PIDFILE"
log_action_end_msg 0
fi
log_action_begin_msg "Syncing disks again"
sync
log_action_end_msg 0
}
case "$1" in
start)
do_start
;;
stop)
do_stop
;;
status)
PID=`cat "$PIDFILE" 2> /dev/null`
if [ "$PID" = "" ] ; then
echo "ZFS-FUSE is not running"
exit 3
else
if kill -0 $PID
then
echo "ZFS-FUSE is running, pid $PID"
zpool status
exit 0
else
echo "ZFS-FUSE died, PID files stale"
exit 3
fi
fi
;;
restart|reload|force-reload)
echo "Error: argument '$1' not supported" >&2
exit 3
;;
*)
echo "Usage: $0 start|stop|status" >&2
exit 3
;;
esac
:
-----------------------------------------
root@karen: ~ #
cat /etc/init.d/mountzfs
#! /bin/sh
### BEGIN INIT INFO
# Provides: mountzfs
# Required-Start: mountall
# Required-Stop:
# Default-Start: S
# Default-Stop:
# Short-Description: Enable ZFS-FUSE.
# Description: Enable and mount ZFS filesystems.
### END INIT INFO
case "$1" in
start|stop|"")
/etc/init.d/zfs start
exit $?
;;
restart|reload|force-reload)
echo "Error: argument '$1' not supported" >&2
exit 3
;;
*)
echo "Usage: mountzfs [start|stop]" >&2
exit 3
;;
esac
:
-----------------------------------------
root@karen: ~ #
cat /etc/init.d/umountzfs
#! /bin/sh
### BEGIN INIT INFO
# Provides: umountzfs
# Required-Start: sendsigs
# Required-Stop:
# Default-Start: 6 0
# Default-Stop:
# Short-Description: Disable ZFS-FUSE.
# Description: Unmount and disable ZFS filesystems.
### END INIT INFO
case "$1" in
start|stop|"")
/etc/init.d/zfs stop
exit $?
;;
restart|reload|force-reload)
echo "Error: argument '$1' not supported" >&2
exit 3
;;
*)
echo "Usage: umountzfs [start|stop]" >&2
exit 3
;;
esac
:
-----------------------------------------
root@karen: ~ #
ls -l /etc/rc?.d/*zfs*
lrwxrwxrwx 1 root root 19 2008-06-18 03:52 /etc/rc0.d/S35umountzfs -
> ../init.d/umountzfs
lrwxrwxrwx 1 root root 19 2008-06-18 03:52 /etc/rc6.d/S35umountzfs -
> ../init.d/umountzfs
lrwxrwxrwx 1 root root 18 2008-06-18 03:52 /etc/rcS.d/S35mountzfs -
> ../init.d/mountzfs
-----------------------------------------
root@karen: ~ #