]> git.pld-linux.org Git - packages/util-vserver.git/blame - vprocunhide.init
- init scripts for util-vserver
[packages/util-vserver.git] / vprocunhide.init
CommitLineData
0ef6e1b2
JR
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# Source function library.
9. /etc/rc.d/init.d/functions
10
11[ -n "$UTIL_VSERVER_VARS" ] || $UTIL_VSERVER_VARS=/usr/lib/util-vserver/util-vserver-vars
12if [ ! -e "$UTIL_VSERVER_VARS" ] ; then
13 echo "Can not find util-vserver installation (the file '$UTIL_VSERVER_VARS' would be expected); aborting..." >&2
14 exit 1
15fi
16. "$UTIL_VSERVER_VARS"
17
18case "$1" in
19 start)
20 show "Fixing vservers /proc entries visibility"
21 busy
22 $_VPROCUNHIDE
23 RETVAL=$?
24 deltext
25 case "$RETVAL" in
26 0) ok;;
27 2) ok; RETVAL=0;;
28 *) fail;;
29 esac
30 [ "$RETVAL" -eq 0 ] && touch /var/lock/subsys/vprocunhide
31 ;;
32 stop)
33 show "Stopping vservers /proc entries visibility"
34 busy
35 rm -f /var/lock/subsys/vprocunhide
36 ok
37 ;;
38 restart|reload)
39 $0 stop
40 $0 start
41 ;;
42 status)
43 if [ -f /var/lock/subsys/vprocunhide ] ; then
44 echo "vservers /proc entries were fixed"
45 else
46 echo "vservers /proc entries are not fixed"
47 fi
48 ;;
49 *)
50 echo "Usage: $0 {start|stop|reload|restart|status}"
51 exit 1
52 ;;
53esac
54
55exit $RETVAL
56
57# This must be last line !
58# vi:syntax=sh:tw=78:ts=8:sw=4
This page took 0.030668 seconds and 4 git commands to generate.