[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#737759: hurd: Add init.d script to create /var/run/mtab



Package: hurd
Version: 1:0.5.git20140203-1
Severity: important
Tags: patch

At the moment in unstable when booting Hurd using sysvinit, df and
friends do not work because /var/run/mtab do not exist.  It should point
to /proc/mounts, and this is done in /etc/hurd/rc when not booting using
sysvinit.

Instead of creating the symlink in /etc/hurd/rc, I suggest to create a
new init.d script to create this symlink, and drop the code from
/etc/hurd/rc.  The following script is tested and found to be working
well.  It creates /run/mtab because /var/run is a symlink to /run.

#! /bin/sh
### BEGIN INIT INFO
# Provides:          hurd-mtab
# Required-Start:    mountkernfs
# Required-Stop:
# Default-Start:     S
# Default-Stop:
# Short-Description: Create /run/mtab -> /proc/mount symlink on Hurd
### END INIT INFO

# Author: Petter Reinholdtsen

# PATH should only include /usr/* if it runs after the mountnfs.sh script
PATH=/sbin:/bin

# Load the VERBOSE setting and other rcS variables
. /lib/init/vars.sh

# Define LSB log_* functions.
# Depend on lsb-base (>= 3.2-14) to ensure that this file is present
# and status_of_proc is working.
. /lib/lsb/init-functions

case "$1" in
  start)
	[ "$VERBOSE" != no ] && log_action_begin_msg "Creating /run/mtab symlink"
	ln -s /proc/mount /run/mtab
	case "$?" in
		0|1) [ "$VERBOSE" != no ] && log_action_end_msg 0 ;;
		2) [ "$VERBOSE" != no ] && log_action_end_msg 1 ;;
	esac
	;;
  stop|restart|force-reload|status)
	;;
  *)
	echo "Usage: $SCRIPTNAME {start|stop|status|restart|force-reload}" >&2
	exit 3
	;;
esac

:

-- 
Happy hacking
Petter Reinholdtsen


Reply to: