> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> hil
>
> Benedict Verheyen wrote:
>> i had problems with vservers not starting (or so i thought) after a
>> system
>> reboot on my Debian Sarge.
>> Some particulars of my system:
>> - debootstrap install of vservers
>> - most vservers have at least 1 shared directories with host (apt cache)
>> - hashified
>> - lastest util-vserver
>> - kernel 2.6.16
>> - debian sarge
>> - 7 vservers
>>
>> What happened when i rebooted is that i saw these lines:
>> ------------------------------------------------------
>> Fixing visibility of /proc entries for vservers...done
>> Starting vservers of type default...
>> ------------------------------------------------------
>>
>> And then it seemed as if my system hung but i could actually do a 3
>> fingered salute. So hanging is not the right wording, rather "not
>> responding".
>
> i actually had the same problem... you go onto describe how you (almost)
> figured
> out the problem in this email, it seems that you didn't quite make the
> final
> connection: it's not really a problem with the vservers themselves taking
> a long
> time, it's a problem in the order in which they are starting, with the
> non-dns
> vservers starting first and therefore hanging whilst they wait for network
> connections to time out.
>
>> I had what appeared to be some dead links in my /etc/rc2.d:
>> vprocunhide rebootmgr vservers-default vservers-legacy
>> They don't seem to be used anymore so i removed them. Now only a link to
>> /etc/init.d/util-vserver is in there
>>
>> Anyway, i edited /etc/default/util-vserver and set the following:
>> mark=
>> auto=false
>
> i did this as well. it temporarily solves the problem to find the answer,
> as you
> say.
>
>> This prevented the vservers to load on boot (which i actually want and
>> need but disabled to see what's going on).
>> I then rebooted and started a vserver manually and instead of the
>> startup
>> lines zipping by it took ages for it to print some lines so now i knew
>> "Starting vservers of type default..." was actually not hanging my
>> computer but rather just going very very slow.
>
> which lines? i suspect they are the ones about various network connections
> for
> your vserver (trying to resolve hostname, for example).
>
>> I started all my vservers and after about 10 minutes (i had started an
>> uml
>> to get DNS going) i decided to shut down the uml that provided dns and
>> start the vserver instead that also provides dns.
>> Well, to my surprise, that one started quickly again.
>> Entering the vservers was also quick again. Very strange.
>
> no - you now have your dns working, hence it doesn't need to wait for
> network
> timeouts.
>
>> Now it all works again but as you can imagine, i wouldn't want to reboot
>> :)
>>
>> 1. What could be causing the slow startup?
>>
>> 2. What links are necessary in /etc/rc2.d?
>> vprocunhide, rebootmgr, vservers-default & vservers-legacy point nowhere
>> only util-vserver seems to be valid
>
> i've got the similar system set up as you (debian sarge 2.6.16 etc). there
> was
> something like:
>
> /etc/init.d/vserver-default
>
> and created
>
> /etc/init.d/vserver-dnsserver
> /etc/init.d/vserver-mailserver
>
> etc, so that i could start the vservers in a specific order by linking
> them into
> /etc/rc?.d/* as appropriate.
>
>> 3. I have my DNS inside a vserver, so the DNS vserver should be started
>> as early as possible.
>> How do i do that if the links above aren't valid?
>> Can i move the util-vserver link and then use the mark file to
>> accomplish
>> that?
>
> you still use the mark file to specifiy which start-up script starts which
> vserver:
>
> user@host:~$ cat /etc/vservers/vsdns/apps/init/mark
> dnsserver
> user@host:~$ cat /etc/vservers/vsmail/apps/init/mark
> mailserver
> user@host:~$ cat /etc/vservers/vshttp/apps/init/mark
> default
>
> so i can get them to start in what ever order i like, depending upon the
> order
> in /etc/rc?.d/ .
>
>> 4. Is there a way to start some vservers early and other less critical
>> vservers at the end of the boot sequence?
>
> as above.
>
>> Some more information:
>>
>>> testme.sh
>> Linux-VServer Test [V0.15] Copyright (C) 2003-2006 H.Poetzl
>> chcontext is working.
>> chbind is working.
>> Linux 2.6.16-vs2.0.2-rc15.10apr2006 #1 Tue Apr 11 13:02:54 CEST 2006
>> i686
>> Ea 0.30.210 273/glibc (DSa) <compat,v11,fscompat,v13,net,oldproc,olduts>
>> VCI: 0002:0001 273 03000036 (TbLgnP)
>> ---
>> [000]# succeeded.
>> [001]# succeeded.
>> [011]# succeeded.
>> [031]# succeeded.
>> [101]# succeeded.
>> [102]# succeeded.
>> [201]# succeeded.
>> [202]# succeeded.
>>
>>> vserver-info - SYSINFO
>> ==============================================================================
>> Versions:
>> Kernel: 2.6.16-vs2.0.2-rc15.10apr2006
>> VS-API: 0x00020001
>> util-vserver: 0.30.210; Apr 19 2006, 16:06:42
>>
>> Features:
>> CC: gcc, gcc (GCC) 3.3.5 (Debian 1:3.3.5-13)
>> CXX: g++, g++ (GCC) 3.3.5 (Debian 1:3.3.5-13)
>> CPPFLAGS: ''
>> CFLAGS: '-Wall -g -O2 -std=c99 -Wall -pedantic -W'
>> CXXFLAGS: '-g -O2 -ansi -Wall -pedantic -W
>> -fmessage-length=0'
>> build/host: i386-pc-linux-gnu/i386-pc-linux-gnu
>> Use dietlibc: yes
>> Build C++ programs: yes
>> Build C99 programs: yes
>> Available APIs: compat,v11,fscompat,v13,net,oldproc,olduts
>> ext2fs Source: e2fsprogs
>> syscall(2) invocation: alternative
>> vserver(2) syscall#: 273/glibc
>>
>> Paths:
>> prefix: /usr
>> sysconf-Directory: /etc
>> cfg-Directory: /etc/vservers
>> initrd-Directory: $(sysconfdir)/init.d
>> pkgstate-Directory: /var/run/vservers
>> vserver-Rootdir: /var/lib/vservers
>> ==============================================================================
>>
>> Thanks,
>> Benedict
>
> hope it helps.
>
> - --
>
> love and solidarity,
>
> --gdm
>
> http://docs.indymedia.org/view/Main/GarconDuMonde
>
> i have a NEW key:
> gpg --keyserver pgp.mit.edu --recv-keys 594B97C2
> Key fingerprint = 7B70 F22D F275 D111 3A04 F9EE 0E25 4944 594B 97C2
>
Hi,
thanks for the info. I think your suggestions will actually solve the
problem i'm having.
Thing is that i'm not sure on how to do it correctly on Debian.
I have a util-vserver script in /etc/init.d
which is linked to from rc2.d:
S23util-vserver -> ../init.d/util-vserver
In /etc/default/util-vserver i reread this comment:
# The vserver initscript runs late in the boot-up sequence, which may
# be inappropriate for services that need to run earlier, such as
# nameservers or VPN tunnels. If a copy of the initscript is made to
# run at an earlier position, you can then set $MARK to be those vservers
# that you want to run then.
#MARK=default
This is confusing to me. The comment says to copy the initscript for those
servers that need to be started earlier but the script looks at
/etc/default/util-vserver to find info on what servers to start first.
So how do i do that? I could copy the script, copy /etc/default/util-vserver
and adjust the MARK & AUTO parameters there but i don't think that's the
proper way to deal with this problem or is it?
Looking at the /etc/init.d/util-vserver script (added as extra info
below), i could make a copy and then put this code in comment
DEBIANCONFIG=/etc/default/util-vserver
if [ -f $DEBIANCONFIG ]
then
. $DEBIANCONFIG
fi
Then add MARK & AUTO in there. For instance, MARK=dnsserver & AUTO=true
Next make a link to this script from /etc/rc2.d at an early stage.
Is this how it should be done?
Thanks,
Benedict
=============================================================================
#!/bin/sh
DEBIANCONFIG=/etc/default/util-vserver
if [ -f $DEBIANCONFIG ]
then
. $DEBIANCONFIG
fi
: ${UTIL_VSERVER_VARS:=/usr/lib/util-vserver/util-vserver-vars}
test -e "$UTIL_VSERVER_VARS" ||
{
echo $"Can not find util-vserver installation (the file
'$UTIL_VSERVER_VARS' is expected); aborting..." >&2
exit 1
}
. "$UTIL_VSERVER_VARS"
PIDFILE=/var/run/rebootmgr.pid
LOCKFILE=$MARK
vprocunhide_lockfile=/var/run/vprocunhide
export MARK NUMPARALLEL LOCKFILE
# Test to see if there are legacy configs around
if [ -f /etc/vservers/*.conf ]
then
legacy=yes
fi
# Print the vserver name in priority/alpha order
# This function is only used for legacy configs
sortserver(){
(
cd $__CONFDIR
for serv in *.conf
do
test -f "$serv" || continue
PRIORITY=100
. $serv
test "$ONBOOT" || continue
printf "%03d %s\n" $PRIORITY `basename $serv .conf`
done
) | sort $* | (while read a b; do echo $b; done)
}
# Start vservers
# This function is only used for legacy configs
startservers(){
cd $__CONFDIR
for name in `sortserver`
do
ONBOOT=
. $name.conf
if [ "$ONBOOT" = "yes" ] ; then
echo "Starting Vservers..."
$_VSERVER_LEGACY $name start
else
echo "virtual server $name not configured for on
boot start"
fi
done
}
start()
{
# First set vserver related attributes for /proc, this
# makes some necessary /proc entries visible in vservers
if [ -e /proc/self/vinfo ]
then
# Check for vc_set_iattr feature, if its not detected, then we are
probably running a
# 2.4 kernel where all of /proc is unhidden by default
$_VSERVER_INFO - FEATURE iattr
if [ $? -eq 0 ]
then
echo -n $"Fixing visibility of /proc entries for Vservers..."
$_VPROCUNHIDE
if [ $? -ne 0 ]
then
echo "Error in setting Vserver related attributes
for /proc"
else
touch "$vprocunhide_lockfile"
echo "done."
fi
fi
# Remove barrier on / if it exists
if [ -e /proc/self/vinfo ]
then
showattr -d / | awk '{print $1'} | grep -q B
if [ $? -eq 0 ]
then
setattr --~barrier /
fi
fi
# Then set the chroot barrier
for vserver in `ls /etc/vservers`
do
vdiractual=`readlink -f /etc/vservers/$vserver/vdir`
if [ -d "$vdiractual" ]
then
setattr --barrier $vdiractual/..
fi
done
vrootactual=`readlink -f /etc/vservers/.defaults/vdirbase`
setattr --barrier $vrootactual
# Then start up vservers with $MARK if $AUTO is set to start things
if [ "$AUTO" = "true" ]
then
exec /usr/lib/util-vserver/vserver-wrapper start;
else
echo "Auto starting of Vservers is not enabled in
$DEBIANCONFIG"
echo "Please start your vservers manually with 'vserver
<vserver-name> start'"
fi
else
echo -n $"Vserver capability not detected in kernel."
fi
echo
}
stop()
{
if [ -e /proc/self/vinfo ]
then
if [ "$AUTO" = "true" ]
then
exec /usr/lib/util-vserver/vserver-wrapper stop;
else
echo "Auto stopping of Vservers is not enabled in
$DEBIANCONFIG"
echo "Please stop your vservers manually with 'vserver
<vserver-name> stop'"
fi
rm -f "$vprocunhide_lockfile"
else
echo -n $"Vserver capability not detected in kernel."
fi
}
forcestop()
{
echo "Stopping all running vservers..."
for vserver in `vserver-stat | grep -v "CTX PROC VSZ RSS
userTIME sysTIME UPTIME NAME" |grep -v ^0 | awk '{print $8}'`
do
echo -n "Stopping $vserver: "
vserver $vserver stop >& /dev/null
echo "done."
done
# This is broken: /usr/lib/util-vserver/start-vservers --stop
--running
}
restart()
{
stop
start
}
case "$1" in
start)
# First run the legacy starts, if there are any
if [ "$legacy" = "yes" ]; then
if [ "$BACKGROUND" = "yes" ] ; then
startservers >/dev/tty8 </dev/tty8 2>/dev/tty8 &
else
startservers
fi
touch /var/lock/subsys/vservers-legacy
fi
# Then start the modern vservers, if there are any
start
;;
stop)
# First stop the legacy vservers
if [ "$legacy" = "yes" ]; then
echo "Stopping Vservers"
cd $__CONFDIR
for name in `sortserver -r`
do
$_VSERVER_LEGACY $name stop
done
rm -f /var/lock/subsys/vservers-legacy
fi
# Then stop the modern vservers
stop
;;
forcestop)
stop
forcestop
;;
restart)
$1
;;
reload)
;;
status)
if [ "$legacy" = "yes" ]; then
cd $__CONFDIR
for serv in *.conf
do
ONBOOT=no
name=`basename $serv .conf`
. $serv
echo -n ONBOOT=$ONBOOT " "
$_VSERVER_LEGACY $name running
done
fi
vserver-info - RUNNING
if [ $? -eq 0 ]
then
vserver-stat
else
echo "vserver enabled kernel not detected"
fi
if [ -f $lockfile ]
then
echo $"/proc entries were fixed for vservers"
else
echo $"/proc entries are not fixed for vservers"
fi
;;
*)
echo "Usage: $0 {start|stop|forcestop|reload|restart|status}"
exit 2
;;
esac
=============================================================================
_______________________________________________
Vserver mailing list
Vserver@list.linux-vserver.org
http://list.linux-vserver.org/mailman/listinfo/vserver
Received on Mon Jun 26 17:23:44 2006