]> git.pld-linux.org Git - packages/util-vserver.git/blame_incremental - vprocunhide.init
- merged from DEVEL: snap 0.30.216 revision 2844
[packages/util-vserver.git] / vprocunhide.init
... / ...
CommitLineData
1#!/bin/sh
2#
3# vprocunhide sets vserver related attributes for /proc
4#
5# chkconfig: 2345 26 74
6# description: Makes some /proc entries visibly for vservers
7#
8# $Id$
9
10# if kernel not capable, exit early
11if [ ! -d /proc/virtual ]; then
12 case "$1" in
13 start|stop|reload|restart)
14 exit 0
15 ;;
16 esac
17fi
18
19# Source function library.
20. /etc/rc.d/init.d/functions
21
22[ -n "$UTIL_VSERVER_VARS" ] || UTIL_VSERVER_VARS=/usr/lib/util-vserver/util-vserver-vars
23if [ ! -e "$UTIL_VSERVER_VARS" ] ; then
24 echo "Can not find util-vserver installation (the file '$UTIL_VSERVER_VARS' would be expected); aborting..." >&2
25 exit 1
26fi
27. "$UTIL_VSERVER_VARS"
28
29$_VSERVER_INFO - FEATURE iattr || exit 0
30
31start() {
32 show "Fixing vservers /proc entries visibility"
33 busy
34 $_VPROCUNHIDE
35 RETVAL=$?
36 deltext
37 case "$RETVAL" in
38 0) ok;;
39 2) ok; RETVAL=0;;
40 *) fail;;
41 esac
42 [ "$RETVAL" -eq 0 ] && touch /var/lock/subsys/vprocunhide
43}
44
45stop() {
46 show "Stopping vservers /proc entries visibility"
47 busy
48 rm -f /var/lock/subsys/vprocunhide
49 ok
50}
51
52case "$1" in
53 start|restart|reload)
54 start
55 ;;
56 stop)
57 stop
58 ;;
59 status)
60 if [ -f /var/lock/subsys/vprocunhide ]; then
61 echo "vservers /proc entries were fixed"
62 else
63 echo "vservers /proc entries were not fixed"
64 fi
65 ;;
66 *)
67 msg_usage "$0 {start|stop|reload|restart|status}"
68 exit 3
69 ;;
70esac
71
72exit $RETVAL
This page took 0.050699 seconds and 4 git commands to generate.