--- /dev/null
+#!/bin/bash
+#
+# vprocunhide sets vserver related attributes for /proc
+#
+# chkconfig: 2345 26 74
+# description: Makes some /proc entries visibly for vservers
+
+: ${UTIL_VSERVER_VARS:=/usr/lib/util-vserver/util-vserver-vars}
+test -e "$UTIL_VSERVER_VARS" || {
+ echo $"Can not find util-vserver installation; aborting...">&2
+ exit 1
+}
+. "$UTIL_VSERVER_VARS"
+
+# Source function library.
+. /etc/rc.d/init.d/functions
+
+lockfile=/var/lock/subsys/vprocunhide
+
+function start()
+{
+ echo -n $"Fixing /proc entries visibility..."
+ $_VPROCUNHIDE
+ rc=$?
+ case "$rc" in
+ 0) success;;
+ 2) rc=0; passed;;
+ *) failure;
+ esac
+ echo
+ test "$rc" -ne 0 || touch "$lockfile"
+ return $rc
+}
+
+function stop()
+{
+ rm -f "$lockfile"
+}
+
+function restart()
+{
+ stop
+ start
+}
+
+case "$1" in
+ start|stop|restart) $1;;
+ reload) ;;
+ condrestart)
+ test -f $lockfile && restart || :
+ ;;
+ status)
+ test -f $lockfile && {
+ echo $"/proc entries were fixed"
+ exit 0
+ }
+ echo $"/proc entries are not fixed"
+ exit 1
+ ;;
+ *)
+ echo "Usage: $0 {start|stop|reload|restart|condrestart|status}"
+ exit 2
+ ;;
+esac
+
+