#!/bin/sh
#
# $Id$
#

# PROVIDE: isi_mount_ifs
# REQUIRE: isi_post_network isi_mcp isi_testjournal

. /etc/rc.subr

name="isi_mount_ifs"
start_cmd="echo 'Mounting IFS filesystem...'; mount -a -t efs"
# OneFS is umounted in isi_post_shutdown.
stop_cmd="/usr/bin/true"

# Create a flag file to indicate to drive_d that isi_mount_ifs has
# run.
touch_mount_ifs_flag()
{
    touch /var/run/isi_mount_ifs_already_ran
    chmod 640 /var/run/isi_mount_ifs_already_ran
}

load_rc_config $name
run_rc_command "$1"

if [ $? -eq 0 ]; then
    # the flag file is created programmatically by libisi_newfs
    /usr/bin/logger -i -p ifs.notice "IFS mounted successfully."
else
    touch_mount_ifs_flag
    ERRMSG="IFS failed to mount.  Aborting boot."
    /usr/bin/logger -i -p ifs.err "$ERRMSG"
    echo "Aborting boot."
    /usr/sbin/isi_stop_boot "$ERRMSG"
fi
