|
@@ -15,7 +15,7 @@
|
|
|
# Provides: aoe aoetools
|
|
|
# Required-Start: $local_fs $network
|
|
|
# Required-Stop: $local_fs $network
|
|
|
-# Should-Start:
|
|
|
+# Should-Start:
|
|
|
# Default-Start: S
|
|
|
# Default-Stop: 0 6
|
|
|
# Short-Description: Begin AoE discovery and mount related filesystems.
|
|
@@ -43,7 +43,7 @@ create_fs_list() {
|
|
|
[ -f /etc/fstab ] || return
|
|
|
#
|
|
|
# Read through fstab line by line. If it contains /dev/etherd, set the flag
|
|
|
- # for mounting file systems over AoE.
|
|
|
+ # for mounting file systems over AoE.
|
|
|
#
|
|
|
|
|
|
exec 9<&0 </etc/fstab
|
|
@@ -71,7 +71,7 @@ do_start() {
|
|
|
# We exit if the user does not want us to try this.
|
|
|
if [ "$INTERFACES" = "none" ]
|
|
|
then
|
|
|
- echo "not started."
|
|
|
+ echo "INTERFACES='none' in /etc/default/aoetools, not started."
|
|
|
exit 0
|
|
|
fi
|
|
|
|
|
@@ -116,7 +116,7 @@ do_start() {
|
|
|
echo
|
|
|
echo "The LVM2 tools are not present. Please install lvm2 package and try again." >&2
|
|
|
echo "We will not honour LVMGROUPS." >&2
|
|
|
- LMVGROUPS=''
|
|
|
+ LVMGROUPS=''
|
|
|
fi
|
|
|
|
|
|
if [ -n "$LVMGROUPS" ]
|
|
@@ -166,24 +166,41 @@ do_stop() {
|
|
|
modprobe --remove aoe >/dev/null 2>&1 || true
|
|
|
}
|
|
|
|
|
|
+do_status() {
|
|
|
+ if $(lsmod |grep -qw '^aoe\s')
|
|
|
+ then
|
|
|
+ echo 'The aoe module is loaded.'
|
|
|
+ fi
|
|
|
+ # FIXME: Make something smarter like detect udev or a monolithic kernel.
|
|
|
+
|
|
|
+ AOE_MOUNTS="$(grep '/dev/etherd/' /proc/mounts)"
|
|
|
+ if [ -n "$AOE_MOUNTS" ]
|
|
|
+ then
|
|
|
+ echo 'The following AoE file systems are mounted:'
|
|
|
+ echo "$AOE_MOUNTS" | awk '{print $2}'
|
|
|
+ else
|
|
|
+ echo 'No AoE file systems mounted.'
|
|
|
+ fi
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
case "$1" in
|
|
|
- start|restart|reload|force-reload)
|
|
|
- echo -n "Starting $DESC: "
|
|
|
-
|
|
|
- do_start
|
|
|
-
|
|
|
- ;;
|
|
|
- stop)
|
|
|
- echo "Stopping $DESC: "
|
|
|
-
|
|
|
- do_stop
|
|
|
-
|
|
|
- ;;
|
|
|
- *)
|
|
|
- N=/etc/init.d/$NAME
|
|
|
- echo "Usage: $N {start|stop|restart|reload|force-reload}" >&2
|
|
|
- exit 1
|
|
|
- ;;
|
|
|
+ start|restart|reload|force-reload)
|
|
|
+ echo -n "Starting $DESC: "
|
|
|
+ do_start
|
|
|
+ ;;
|
|
|
+ stop)
|
|
|
+ echo "Stopping $DESC: "
|
|
|
+ do_stop
|
|
|
+ ;;
|
|
|
+ status)
|
|
|
+ do_status
|
|
|
+ ;;
|
|
|
+ *)
|
|
|
+ N=/etc/init.d/$NAME
|
|
|
+ echo "Usage: $N {start|stop|restart|reload|force-reload|status}" >&2
|
|
|
+ exit 1
|
|
|
+ ;;
|
|
|
esac
|
|
|
|
|
|
exit 0
|