Re: [vserver] hashify cleanup

From: Eugen Leitl <>
Date: Mon 12 Apr 2010 - 11:56:22 BST
Message-ID: <>

On Mon, Apr 12, 2010 at 09:10:30AM +0200, Ghislain wrote:

> then you should have /var/lib/vservers and not /vservers. The '-debian'

I can nuke /vservers completely on a Debian machine, correct?

> tools are compiled for vservers in the debian directory.
> see

I've modified the vserver build/init script to address
Debian-specificities. If called as ./buildall 1 254
it builds to servers.

Does below make sense to you? Thanks!

set -x

mkdir -p /etc/vservers/.defaults/apps/vunify/hash
mkdir -p /var/lib/vservers/.hash
ln -s /var/lib/vservers/.hash /etc/vservers/.defaults/apps/vunify/hash/0

function buildvs(){
        vserver v${IP} build --force -n v${IP} --hostname v${IP} --context ${IP} --interface eth0:192.168.1.${IP}/24 -m debootstrap -- -d lenny
        echo ${IP} > /etc/vservers/v${IP}/context
        echo "default" > /etc/vservers/v${IP}/apps/init/mark
        vserver v${IP} start
        vserver v${IP} exec apt-get update
        vserver v${IP} exec apt-get -y install locales nginx
        vserver v${IP} exec apt-get -y upgrade
        mkdir -p /etc/vservers/v${IP}/apps/vunify
        vserver v${IP} hashify

for i in `seq $IPstart $IPend`;
        buildvs $i

find /var/lib/vservers/.hash -type f -links 1 -exec rm -v '{}' ';'

Here is the script to modify existing vservers, called e.g.
as ./modall 1 254 :

set -x

function process () {
        vserver v${1} restart
        vserver v${1} exec apt-get update
        vserver v${1} exec sh -c 'export DEBIAN_FRONTEND=noninteractive; apt-get -y --force-yes install locales nginx postfix;'
        vserver v${1} exec apt-get -y upgrade
        vserver v${1} hashify

for i in `seq $IPstart $IPend`;
        process $i

find /var/lib/vservers/.hash -type f -links 1 -exec rm -v '{}' ';'

Eugen* Leitl leitl
ICBM: 48.07100, 11.36820
8B29F6BE: 099D 78BA 2FD3 B014 B08A  7779 75B0 2443 8B29 F6BE
Received on Mon Apr 12 11:56:36 2010
[Next/Previous Months] [Main vserver Project Homepage] [Howto Subscribe/Unsubscribe] [Paul Sladen's vserver stuff]
Generated on Mon 12 Apr 2010 - 11:56:38 BST by hypermail 2.1.8