3 # vprocunhide sets vserver related attributes for /proc
5 # chkconfig: 2345 26 74
6 # description: Makes some /proc entries visibly for vservers
10 # if kernel not capable, exit early
11 if [ ! -d /proc/virtual ]; then
13 start|stop|reload|restart)
19 # Source function library.
20 . /etc/rc.d/init.d/functions
22 [ -n "$UTIL_VSERVER_VARS" ] || UTIL_VSERVER_VARS=/usr/lib/util-vserver/util-vserver-vars
23 if [ ! -e "$UTIL_VSERVER_VARS" ] ; then
24 echo "Can not find util-vserver installation (the file '$UTIL_VSERVER_VARS' would be expected); aborting..." >&2
27 . "$UTIL_VSERVER_VARS"
30 show "Fixing vservers /proc entries visibility"
32 ${_SETATTR} -Rx --hide /proc 2>/dev/null
41 [ "$RETVAL" -eq 0 ] && touch /var/lock/subsys/vprocunhide
45 # XXX why start and stop both do --hide?
46 show "Stopping vservers /proc entries visibility"
48 ${_SETATTR} -Rx --hide /proc 2>/dev/null
49 rm -f /var/lock/subsys/vprocunhide
61 if [ -f /var/lock/subsys/vprocunhide ]; then
62 echo "vservers /proc entries were fixed"
64 echo "vservers /proc entries were not fixed"
68 msg_usage "$0 {start|stop|reload|restart|status}"