vserver vstest build --netdev eth0 --interface 192.168.192.168/24 \
--initstyle plain --context 501 --hostname vstest.company.local \
-m debootstrap -- -d sarge -m http://mirror.company.local/debian \
-s /usr/lib/debootstrap/scripts/vserver_sarge
scripts/vserver_sarge is the same as scripts/sarge, our modifications
are:
- remove some packages (don't ask me which ones, I don't remember -
probably the ppp* stuff and maybe something else, but that's not
so important - we could discuss them on the list, more eyes can
for sure find more "useless" packages)
- remove unused arch's
- call our cleanup script after "second_stage_install" like:
install_debs () {
first_stage_install
second_stage_install
. /usr/lib/util-vserver/vserver-cleanup
}
- and now the /usr/lib/util-vserver/vserver-cleanup script (sorry
for posting it here and not using some link / attachment - it
really needed some change / comment as it was very proprietary:
# (error messages are german - but they shouldn't be hard to
# understand / translate)
VS_ETC="/etc/vservers"
# the following line should be replaced by some "sed magic" -
# I never really understood what kind of regex sed is using -
# preg syntax doesn't work, maybe someone has a good link for
# me?! I was too lacy und used perl - sorry!
VS_NAME=`echo $TARGET | perl -e "while (<>) { s/.+\///; print; }"`
VS_ROOT="${VS_ETC}/.defaults/vdirbase/${VS_NAME}"
if [ ! -e $VS_ROOT ]; then
error 1 VS_ROOT "\"$VS_ROOT\" existiert nicht"
fi
if [ -e "${VS_ETC}/${VS_NAME}/uts/nodename" ]; then
VS_HOSTNAME=`cat ${VS_ETC}/${VS_NAME}/uts/nodename`
else
error 1 VS_HOSTNAME "Konnte den Hostname nicht ermitteln"
fi
if [ -e "${VS_ETC}/${VS_NAME}/interfaces/0/ip" ]; then
VS_IPADDR=`cat ${VS_ETC}/${VS_NAME}/interfaces/0/ip`
else
error 1 VS_IPADDR "Konnte die IP-Adresse nicht ermitteln"
fi
mv $VS_ROOT/etc/inittab $VS_ROOT/etc/inittab.dist && \
grep -v respawn\:/sbin/getty $VS_ROOT/etc/inittab.dist \
> $VS_ROOT/etc/inittab
echo "$VS_HOSTNAME" > $VS_ROOT/etc/mailname
echo "$VS_HOSTNAME" > $VS_ROOT/etc/hostname
echo "$VS_IPADDR $VS_HOSTNAME localhost" > $VS_ROOT/etc/hosts
chroot $VS_ROOT shadowconfig on
# copy sources.list from somewhere in /etc/vservers/.defaults/...
# to $VS_ROOT/etc/apt/ - I'm doing something proprietary here
# we are creating a useful bashrc for root fitting our needs,
# probably not useful for everybody, but cut be handled like
# the sources.list
# if this function seems a little bit strange to you have a look
# at my discussion with ola - it's explained (and also simplified)
# there
function update_rc() {
service="$1"
program=`chroot $VS_ROOT which update-rc.d`
if [ -x $VS_ROOT/$program ]; then
chroot $VS_ROOT $program -f $service remove
chroot $VS_ROOT $program $service stop 90 3 .
else
error 1 UPDATE_RC.D "Konnte update-rc.d in VServer nicht ausf�hren"
fi
}
# missing others here - ola should have a full list as he has merged
# this ones - search them in the irc log
for i in klogd networking mountvirtfs mountall.sh mountnfs.sh ifupdown;
do
update_rc $i
done
---
ok, that's it - works fine and has already installed many many
ready-to-use debian vservers. It for sure needs some cleanup, as
ola merged most of this stuff into newvserver we could use his
code in a new cleanup script for debian as a part of util-vserver
somewhere in /usr/lib/util-vserver/distributions/...
this approach needs no modification to vserver-build.functions,
tries to do things the way debian likes it and tries to be as less
"intrusive" as possible.
Cheers,
Thomas Gelf
Am Donnerstag, den 05.05.2005, 11:58 +0200 schrieb Gilles:
> Hello.
>
> Could you please post a full command-line for building a Debian vserver
> by invoking the -s switch?
> Where can I fetch the "magic" script?
>
> Thanks,
> Gilles
> _______________________________________________
> Vserver mailing list
> [email protected]
> http://list.linux-vserver.org/mailman/listinfo/vserver
--
Thomas Gelf <[EMAIL PROTECTED]>
_______________________________________________
Vserver mailing list
[email protected]
http://list.linux-vserver.org/mailman/listinfo/vserver