Top Content Up
Prec

4.9 Executing tasks at vserver start/stop time

Next

You can setup a script called /etc/vservers/XX.sh where XX is the name of the virtual server. This script will be called four time:

  • Before starting the vserver
  • After starting it.
  • Before stopping it.
  • After stopping it.

You generally perform tasks such as mounting file system (mapping some directory in the vserver root using "mount --bind").

Here is an example where you map the /home directory as the vserver /home directory.

#!/bin/sh
case $1 in
pre-start)
	mount --bind /home /vservers/$2/home
	;;
post-start)
	;;
pre-stop)
	;;
post-stop)
	umount /vservers/$2/home
	;;
esac

/etc/vservers/XX.sh

Top Content Up
Prec

Next
Table of content
One big HTML document