[Vserver] Continuing implementaion of a DebSid vserver on a hppa box (need more help)

From: Joel Soete <soete.joel_at_tiscali.be>
Date: Tue 20 Dec 2005 - 15:32:23 GMT
Message-Id: <IRSZ5Z$30924154BA8CF420C99B214E8172569A@scarlet.be>

Hello all,

I come back to my implementation where I would like to use a chroot disk to
either actualy boot a debian-sid server or a vserser DebSid ;-)

To do so, in the guest seerver level, I do first a backup of some /etc subdir:
init.d in init.d.Orig,
default in default.Orig,
rc?.d in rc?.d.Orig

;-)

play a bit around to know which style I would use (I finaly save the vserver
default), which services I would like to run and back final stuff:
init.d in init.d.VPS,
default in default.VPS,
rc?.d in rc?.d.VPS

And use links to switch from orig to vps stuff with following scripts:
# more /etc/vservers/DebSid/scripts/prepre-start
#!/bin/bash
#set -x

echo "$0 fixes sysvinit script's dir."

LNS="/bin/ln -s"
RMF="/bin/rm -f"
VPS_CFG="/var/lib/vservers"
VSP_MP="$VPS_CFG/DebSid"
VSP_Etc="$VSP_MP/etc"
VPS_SUFIX="VPS"
ORIG_SUFIX="Orig"
SUFIX="$VPS_SUFIX"
InitDir="default init.d rc0.d rc1.d rc2.d rc3.d rc4.d rc5.d rc6.d rcS.d"

for dir in $InitDir
do
    cd "$VSP_Etc"

    LN_NAME="$dir"
    LN_SRC="$dir.$SUFIX"

    if [ -d "$LN_SRC" ]
    then
        if [ -h "$LN_NAME" ]
        then
            $RMF "$LN_NAME"
            RC=$?
            if [ $RC -ne 0 ]
            then
                echo "Failed to rm link $LN_NAME: please check !!!"
                exit 1
            else
                $LNS "$LN_SRC" "$LN_NAME"
                RC=$?
                if [ $RC -ne 0 ]
                then
                    echo "Link $LN_NAME -> $LN_SRC failed."
                    exit 1
                else
                    echo "Link $LN_NAME -> $LN_SRC is created."
                fi
            fi
        else
            echo "$LN_NAME is not a link: please check !!!"
            exit 1
        fi
    else
        echo "$LN_SRC doesn't exist: please check !!!"
        exit 1
    fi
done

exit 0
====<>====
# diff -Nau /etc/vservers/DebSid/scripts/prepre-start
/etc/vservers/DebSid/scripts/postpost-stop
--- /etc/vservers/DebSid/scripts/prepre-start 2005-12-19 18:24:39.000000000
+0100
+++ /etc/vservers/DebSid/scripts/postpost-stop 2005-12-19 18:24:56.000000000
+0100
@@ -10,7 +10,7 @@
 VSP_Etc="$VSP_MP/etc"
 VPS_SUFIX="VPS"
 ORIG_SUFIX="Orig"
-SUFIX="$VPS_SUFIX"
+SUFIX="$ORIG_SUFIX"
 InitDir="default init.d rc0.d rc1.d rc2.d rc3.d rc4.d rc5.d rc6.d rcS.d"
 
 for dir in $InitDir
====<>====

1st question:
would it not be better to move prepre and postpost to simply pre and post, so
that I could get rid of relative /var/lib/vservers/DebSid path?

2d question (about data insulation?):

as per debian implementation old chroot disk partition:
#/dev/sdl5 /chroot ext3 defaults,errors=continue
  0 1
/dev/sdl2 none swap sw
  0 0
#proc-du /chroot/proc proc
defaults,errors=continue 0 0
#devpts /chroot/dev/pts devpts defaults,errors=continue
  0 0
#/dev/sdl3 /chroot/boot ext3 defaults,errors=continue
  0 2
#/dev/sdl6 /chroot/var ext3 defaults,errors=continue
  0 2
#/dev/sdl7 /chroot/tmp ext3 defaults,errors=continue
  0 2
#/dev/sdl8 /chroot/home ext3 defaults,errors=continue
  0 2
#/dev/sdl9 /chroot/Develop ext3 defaults,errors=continue
  0 2

Became:
# Debian unstable (aka sid) for vserver
/dev/sdl5 /var/lib/vservers/DebSid ext3
defaults,errors=continue 0 1
/dev/sdl3 /var/lib/vservers/DebSid/boot ext3
defaults,errors=continue 0 2
/dev/sdl6 /var/lib/vservers/DebSid/var ext3
defaults,errors=continue 0 2
/dev/sdl7 /var/lib/vservers/DebSid/tmp ext3
defaults,errors=continue 0 2
/dev/sdl8 /var/lib/vservers/DebSid/home ext3
defaults,errors=continue 0 2
/dev/sdl9 /var/lib/vservers/DebSid/Develop ext3
defaults,errors=continue 0 2
 
and adapted mtab and fstab as follow:
# more /etc/vservers/DebSid/apps/init/mtab
/dev/sdl5 / ext3 rw,errors=continue 0 0
/dev/sdl3 /boot ext3 rw,errors=continue 0 0
/dev/sdl6 /var ext3 rw,errors=continue 0 0
/dev/sdl7 /tmp ext3 rw,errors=continue 0 0
/dev/sdl8 /home ext3 rw,errors=continue 0 0
/dev/sdl9 /Develop ext3 rw,errors=continue 0 0

# more /etc/vservers/DebSid/fstab
none /proc proc defaults 0 0
#none /tmp tmpfs size=16m,mode=1777 0 0
none /dev/pts devpts gid=5,mode=620 0 0

to get a usefull df -k when enter the guest vps ;-)

BUT the from the host I can always access and modify data into guest dedicated
fs (and btw I risk to corupt a guest service config by accident because the
host ignore, well doesn't show, processes owned by guest).

My question is so: is it possible to configure another way the guest server to
hide its data from host?

3rd Question:
as per debian install (eventhought I had to install util-vserver from src), I
install folowing startup scripts:
update-rc.d vprocunhide defaults 25 15
update-rc.d vservers-legacy defaults 90 02
update-rc.d rebootmgr defaults 30 10
update-rc.d vservers-default defaults 90 02

which work fine but didn't startup my DebSid guest server (which elsewhere
works fine manualy: vserver DebSid start/enter ;-).

Any idea what I missed?

(btw I also touch a /etc/vservers/.defaults/app/vshelper/debug and filled in
"/var/log/VPS-dbg.log" in /etc/vservers/.defaults/app/vshelper/logfile but no
such file was created nor can I grab any debug info.
Any idea?

Many thanks for your patience and kind attention,
    Joel --------------------------------------------------------------- A free anti-spam and anti-virus filter on all Scarlet mailboxes More info on http://www.scarlet.be/

_______________________________________________
Vserver mailing list
Vserver@list.linux-vserver.org
http://list.linux-vserver.org/mailman/listinfo/vserver
Received on Tue Dec 20 15:32:48 2005

[Next/Previous Months] [Main vserver Project Homepage] [Howto Subscribe/Unsubscribe] [Paul Sladen's vserver stuff]
Generated on Tue 20 Dec 2005 - 15:32:55 GMT by hypermail 2.1.8