bugutil-vserver - Bugs: bug #20475, The stop script of the virtual...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #20475: The stop script of the virtual machine is not run in the virtual network context.

Submitted by:  Ramón García (Kotasoft S.L) <ramon_kotasoft>
Submitted on:  Fri 13 Jul 2007 10:41:46 AM UTC  
 
Category: NoneSeverity: 3 - Normal
Item Group: VServer buildStatus: Fixed
Privacy: PublicAssigned to: Daniel Hokka Zakrisson <daniel_hozac>
Open/Closed: ClosedComponent Version: stable
Release: 0.30, 0.29

Fri 13 Jul 2007 03:02:28 PM UTC, comment #4:

You know vserver-utils != util-vserver, right? Regardless, 0.28 is at least 3 years old, depending on which one you used... Same goes for 0.29 and 0.30. In addition to that, the oldest version shipped in any current Debian-release is 0.30.204-5sarge3.

I've fixed it in trunk.

Daniel Hokka Zakrisson <daniel_hozac>
Project MemberIn charge of this item.
Fri 13 Jul 2007 02:52:49 PM UTC, comment #3:

I saw the problem in vserver-utils 0.28 (bundled with Debian/GNU Linux), but I downloaded the last version of vserver-utils, and the relevant code of the script vserver.stop seems to be the same.

Ramón García (Kotasoft S.L) <ramon_kotasoft>
Fri 13 Jul 2007 02:37:33 PM UTC, comment #2:

Wow, I was certain I had fixed this like a year ago. Thanks.

As to why it only works sometimes, I'd assume that's due to your the script you're running, not chbind... A simple cat /proc/self/ninfo added to the top of your script should verify that.

Daniel Hokka Zakrisson <daniel_hozac>
Project MemberIn charge of this item.
Fri 13 Jul 2007 10:55:22 AM UTC, comment #1:

After making the change, it works sometimes. why?

Ramón García (Kotasoft S.L) <ramon_kotasoft>
Fri 13 Jul 2007 10:41:46 AM UTC, original submission:

When vserver <machine> stop is run. the stop script (configured with cmd.stop) sees the network of the host, rather than the network of the virtual machine.

The issue is in the vserver.stop script. The script does not perform chbind. Looking at the code

if test -n "$_IS_FAKEINIT" && \
$_VSERVER_INFO - FEATURE vkill; then
if ! vshelper.isStopSync; then
$_VKILL -s INT --xid "$S_CONTEXT" -- 1 || fail=1
fi
elif $_VSERVER_INFO - FEATURE migrate; then
"${NICE_CMD[@]}" \
$_VCONTEXT $SILENT_OPT --migrate --chroot --xid "$S_CONTEXT" -- \
"${INITCMD_STOP[@]}" || fail=1
else
"${NICE_CMD[@]}" \
"$_CHBIND" "${CHBIND_OPTS[@]}" \
"$_EXEC_ULIMIT" "$VSERVER_DIR/ulimits" \
$_CHCONTEXT_COMPAT "${CHCONTEXT_OPTS[@]}" \
"$_CAPCHROOT" "${CAPCHROOT_OPTS[@]}" "." \
"${INITCMD_STOP[@]}" || fail=1

I fixed it by adding a line

"$_CHBIND" "${CHBIND_OPTS[@]}" \

in the second case (the elif one):

elif $_VSERVER_INFO - FEATURE migrate; then
"${NICE_CMD[@]}" \
"$_CHBIND" "${CHBIND_OPTS[@]}" \
$_VCONTEXT $SILENT_OPT --migrate --chroot --xid "$S_CONTEXT" -- \
"${INITCMD_STOP[@]}" || fail=1

Now it works perfectly.

This causes the shutting down of Tomcat in a virtual machine to fail. The stop script is run in the network context of the host, rather than in the context of the machine.

We have a virtual machine with Tomcat. We have a cmd.start that starts Tomcat, and a cmd.stop that shutdowns Tomcat. To perform the shutdown, Tomcat sends a TCP message to a port, which the server receives and shuts down.

Ramón García (Kotasoft S.L) <ramon_kotasoft>

 

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by daniel_hozac (Posted a comment)
  • -unavailable- added by ramon_kotasoft (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 3 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Fri 13 Jul 2007 03:02:28 PM UTCdaniel_hozacOpen/ClosedOpen=>Closed
    Fri 13 Jul 2007 02:37:33 PM UTCdaniel_hozacStatusNone=>Fixed
      Assigned toNone=>daniel_hozac

    Back to the top


    Powered by Savane 3.1-cleanup1