Sophie

Sophie

distrib > Fedora > 17 > i386 > media > updates > by-pkgid > b50d8ee6d7871fcc13c0677a9364ed59 > files > 242

bcfg2-doc-1.3.0-1.fc17.noarch.rpm

.. -*- mode: rst -*-

.. _server-plugins-probes-vserver:

vserver
=======

Detect if the server is a Linux-VServer host.

.. code-block:: sh

    #!/bin/sh

    # Test the proc
    TEST=`cat /proc/self/status|grep s_context| cut -d":" -f2|cut -d" " -f 2`

    case "$TEST" in
      "")
        # Not a vserver kernel
        echo group:host
        ;;
      "0")
        # Vserver kernel but it is the HOST
        echo group:host
        ;;
      [0-9]*)
        # Vserver
        echo group:vserver
        ;;
    esac