About this list Date view Thread view Subject view Author view Attachment view

From: Darryl Ross (spam_at_afoyi.com)
Date: Mon 17 Jan 2005 - 08:34:49 GMT


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Darryl Ross wrote:

| I have also attached the bash script that I am using. Note that it is
| _very_ rough. It Works For Me(tm). Hopefully it's self-explanitory. The
| $TYPE is just the name of the init-script that starts the particular
| vserver. The default init-scripts start 'default', I've created 'core',
| 'optional' and 'customer' on my systems.

Helps if I actually do, no??

I hate that.

Darryl
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (MingW32)

iD8DBQFB63ip/XQ6DbmPjokRAv7cAJsHSaZx/iwiMLvlXB2hdwTCPrgpWACdFTU7
93Gnsrft9ItVGEoJjDUz0Q4=
=dr9f
-----END PGP SIGNATURE-----

#!/bin/sh

# Values passed in on command line options
NAME=$1
IP=$2
CONTEXT=$3
TYPE=$4

# Default values
BCAST=202.191.97.159
DEVICE=eth0
DIR=/etc/vservers/${NAME}
DOMAIN=afoyi.com
NETMASK=255.255.255.224

# Make sure the name does not already exist
if [[ -d ${DIR} ]]; then
        echo "Error: vserver ${NAME} already exists"
        exit
fi

# Make the directory structure
mkdir ${DIR}
mkdir ${DIR}/apps
mkdir ${DIR}/apps/init
mkdir ${DIR}/interfaces
mkdir ${DIR}/interfaces/00
mkdir ${DIR}/uts

# Set up the symbolic links
ln -s /var/run/vservers/${NAME} ${DIR}/run
ln -s /var/run/vservers.rev/ ${DIR}/run.rev
ln -s /vservers/${NAME} ${DIR}/vdir

# Set which group starts this vserver
echo ${TYPE} > ${DIR}/apps/init/mark

# Set up the names & domain
echo ${NAME} > ${DIR}/name
echo ${NAME}.${DOMAIN} > ${DIR}/uts/nodename
echo ${DOMAIN} > ${DIR}/uts/domainname

# Set up our context id
echo ${CONTEXT} > ${DIR}/context

# Set up our nice level
echo 5 > ${DIR}/nice

# Set up the network information
echo ${IP} > ${DIR}/interfaces/00/ip
echo ${DEVICE} > ${DIR}/interfaces/00/dev
echo ${NETMASK} > ${DIR}/interfaces/00/mask
echo ${BCAST} > ${DIR}/interfaces/00/bcast

# Build the FSTAB
echo "none /proc proc defaults 0 0" > ${DIR}/fstab
echo "none /tmp tmpfs size=16m,mode=1777 0 0" >> ${DIR}/fstab
echo "none /dev/pts devpts gid=5,mode=620 0 0" >> ${DIR}/fstab

_______________________________________________
Vserver mailing list
Vserver_at_list.linux-vserver.org
http://list.linux-vserver.org/mailman/listinfo/vserver


About this list Date view Thread view Subject view Author view Attachment view
[Next/Previous Months] [Main vserver Project Homepage] [Howto Subscribe/Unsubscribe] [Paul Sladen's vserver stuff]
Generated on Mon 17 Jan 2005 - 08:35:24 GMT by hypermail 2.1.3