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.

Submitter:  Ramón García (Kotasoft S.L) <ramon_kotasoft>
Submitted:  Fri 13 Jul 2007 10:41:46 AM UTC
   
 
Category:  None Severity:  3 - Normal
Item Group:  VServer build Status:  Fixed
Privacy:  Public Assigned to:  daniel_hozac
Open/Closed:  Closed Component 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>
Group Member
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>
Group Member
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>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

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

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2007-07-13 daniel_hozac Open/ClosedOpen Closed
    2007-07-13 daniel_hozac StatusNone Fixed
        Assigned toNone daniel_hozac

    Back to the top

    Powered by Savane 3.15.
    Corresponding source code