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

From: Christian Jaeger (christian.jaeger_at_ethlife.ethz.ch)
Date: Mon 12 Apr 2004 - 04:56:51 BST


This is on a host with 2.4.25+grsec+vs1.3.8.

Multiple problems with reboot from inside a vserver running debian sarge (testing):

1.- Not a problem of the utils but of my setup:
I have a setup where the vserver tools are inside a chroot, not on the plain host. This is because I want to keep woody on the host, but the alpha tools only compile on sarge/sid. So I have sarge in a chroot, installed util-vserver-0.29.207 there, and for vserver maintenance I first enter this chroot. Since the reboot request is made by the kernel to the plain host, I had to write a proxy vshelper script:

#!/bin/sh
# cj Mon, 12 Apr 2004 04:51:16 +0200
# proxy kernel requests into the chroot (sigh)
cmd="chroot /chroot-sarge /opt/vserver/lib/util-vserver/vshelper $2 $1"
{
 echo "`date -R` cmd='$cmd'"
 $cmd
 res="$?"
 echo "`date -R` returned from chroot with: res = $res"
} >> /tmp/root/vshelper.log 2>&1

Additionally, I had to comment out this part in the original vshelper script to be able to see what's happening (I should probably have defined logfile settings--but then again I just wanted the output directed to my log together with my own output from the proxy script):

#if ! tty -s; then
# findObject -e _VS_LOGFILE "$CONFDIR"/.defaults/apps/vshelper/logfile /dev/null
# findObject -e _VS_ERRFILE "$CONFDIR"/.defaults/apps/vshelper/logfile /dev/null
#
# exec >>$_VS_LOGFILE
# exec 2>>$_VS_ERRFILE
#fi

2.- As you can see from the above script, I had to change the order of the arguments to make it work. Before that, vshelper complained about
 No responsible vserver found for xid 'restart2' (restart2); aborting...

3.- Only "reboot -f" does seem to work in debian, "shutdown -f now", "halt" etc are just complaining about missint /dev/initctl and stop. Why is there no initctl if there is an init process running? (The rather strange thing about this is, that reboot -f usually does circumvent the normal shutdown process, but in this vserver case, it will still shut down the vserver cleanly (wrong "semantics").)

4.- Rather cosmetic, but it might interest you: the vshelper is triggered twice for each argument (four times in total) for one "reboot -f":

Mon, 12 Apr 2004 05:30:48 +0200 cmd='chroot /chroot-sarge /opt/vserver/lib/util-vserver/vshelper 49169 restart'
Mon, 12 Apr 2004 05:30:48 +0200 cmd='chroot /chroot-sarge /opt/vserver/lib/util-vserver/vshelper 49169 restart2'
Mon Apr 12 05:30:48 CEST 2004: vshelper 49169 restart
Mon Apr 12 05:30:48 CEST 2004: vshelper 49169 restart2
Restarting vserver '/opt/vserver/etc/vservers/sarge'
Mon, 12 Apr 2004 05:30:49 +0200 returned from chroot with: res = 0
stty: standard input: Inappropriate ioctl for device
Stopping portmap daemon: portmap.
Sending all processes the TERM signal...done.
Sending all processes the KILL signal...done.
Saving random seed...done.
Unmounting remote and non-toplevel virtual filesystems...done.
Deconfiguring network interfaces...done.
Deactivating swap...umount: none: not found
umount: /tmp: must be superuser to umount
Not superuser.
done.
Unmounting local filesystems...umount: none: not found
umount: /tmp: must be superuser to umount
umount: /dev/hdv1: not mounted
done.
mount: permission denied
Rebooting... Mon, 12 Apr 2004 05:30:56 +0200 cmd='chroot /chroot-sarge /opt/vserver/lib/util-vserver/vshelper 49169 restart'
Mon, 12 Apr 2004 05:30:56 +0200 cmd='chroot /chroot-sarge /opt/vserver/lib/util-vserver/vshelper 49169 restart2'
Mon Apr 12 05:30:56 CEST 2004: vshelper 49169 restart
'vshelper' not configured for xid '49169'
Mon, 12 Apr 2004 05:30:56 +0200 returned from chroot with: res = 0
Mon Apr 12 05:30:56 CEST 2004: vshelper 49169 restart2
'vshelper' not configured for xid '49169'
Mon, 12 Apr 2004 05:30:56 +0200 returned from chroot with: res = 0
stty: standard input: Inappropriate ioctl for device
Starting system log daemon: syslogd.
Starting kernel log daemon: klogd.
Starting internet superserver: inetd.
Starting printer spooler: lpd.
Starting mail-transfer agent: qmail.
rsync daemon not enabled in /etc/default/rsync
Starting OpenBSD Secure Shell server: sshd.
Starting deferred execution scheduler: atd.
Starting periodic command scheduler: cron.
Mon, 12 Apr 2004 05:30:57 +0200 returned from chroot with: res = 0

Cheers,
Christian.

_______________________________________________
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 12 Apr 2004 - 04:57:51 BST by hypermail 2.1.3