Sophie

Sophie

distrib > Mageia > 4 > x86_64 > media > core-updates > by-pkgid > 8c4856a6e23d1e738b9d2b7e2d38d69f > files > 2

util-vserver-sysv-0.30.216-0.pre3062.1.mga4.x86_64.rpm

#!/bin/bash
#
# vprocunhide  sets vserver related attributes for /proc
#
# chkconfig: 2345 26 74
# description: Makes some /proc entries visibly for vservers
# 
### BEGIN INIT INFO
# Provides:          vprocunhide
# Required-Start:    $remote_fs $syslog $time
# Required-Stop:     $remote_fs $syslog $time
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: vprocunhide  sets vserver related attributes for /proc
# Description:       vprocunhide  sets vserver related attributes for /proc.
### END INIT INFO

: ${UTIL_VSERVER_VARS:=/usr/share/util-vserver/util-vserver-vars}
test -e "$UTIL_VSERVER_VARS" || {
    echo $"Can not find util-vserver installation (the file '$UTIL_VSERVER_VARS' would be expected); aborting..." >&2
    exit 1
}
. "$UTIL_VSERVER_VARS"

$_VSERVER_INFO - FEATURE iattr || exit 0

LOCKFILE=vprocunhide
. "$_LIB_VSERVER_INIT_FUNCTIONS"


function start()
{
    _beginResult $"Fixing /proc entries visibility"
    $_VPROCUNHIDE
    _endResult $?
    local retval=$?
    test "$retval" -ne 0 || touch "$lockfile"
    return $retval
}

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