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.
|