Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 529972 - app-emulation/xen-tools-4.2.* with init xendomains ver. -r2: multiple problems (lock dom0 shutdown, screen not attached, hanging vm shutdown)
Summary: app-emulation/xen-tools-4.2.* with init xendomains ver. -r2: multiple problem...
Status: RESOLVED NEEDINFO
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Xen Devs
URL:
Whiteboard:
Keywords: PATCH
Depends on:
Blocks:
 
Reported: 2014-11-20 16:25 UTC by Daniele Palumbo
Modified: 2016-12-20 04:16 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
initrd proposed patch (xendomains.initd-r2_20141120.patch,5.12 KB, patch)
2014-11-20 16:31 UTC, Daniele Palumbo
Details | Diff
xendomains needed changes to conf.d xendomains (xendomains.confd_20141120.patch,1.02 KB, patch)
2014-11-20 16:32 UTC, Daniele Palumbo
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Daniele Palumbo 2014-11-20 16:25:19 UTC
I guess that this bug exist on all xen-tools and/or xen version in gentoo.

With current (and somehow previous) init xendomains script, i have faced several problems:
a) if a vm is up, and not included in /etc/xen/auto, it is not shutted down with xendomains. In case of shutdown of the dom0, this will lead to system haning if one lvm disk is still open.

b) if a machine fail to stop within xendomains, this will lead to an infinte look inside xendomains stop. a destroy of the domain should be issued after a certain (customizable) amount of time.

c) screen is not working smoothly, screen -r as root user simply does not work after login. /.screenrc is created.

Patches written by me are attached.

Reproducible: Always

Steps to Reproduce:
Problem a
1. startup xen/xendomain, with a vm on lvm
2. start vm not in /auto/ directory
3. issue shutdown -r


Problem b
1. start xendomains service
2. address somehow one vm, in /auto/ directory, in order to not shut down (ie not unmount a filesystem)
3. stop xendomanis service

Problem c
1. boot dom0 with screen option in conf.d/xendomains
2. issue screen -r
Actual Results:  
Problem a
* dom0 hang

Problem b
* service xendomains will wait forever

Problem c
* screen does not attach

Expected Results:  
Problem a
* dom0 does not hang

Problem b
* xendomains stop in some ways

Problem c
* screen should be easily attachable
Comment 1 Daniele Palumbo 2014-11-20 16:25:45 UTC
Portage 2.2.8-r2 (default/linux/amd64/13.0, gcc-4.8.3, glibc-2.19-r1, 3.14.21-gentoo-Dom0-r3141 x86_64)
=================================================================
System uname: Linux-3.14.21-gentoo-Dom0-r3141-x86_64-Intel-R-_Xeon-R-_CPU_E5620_@_2.40GHz-with-gentoo-2.2
KiB Mem:      435904 total,    104608 free
KiB Swap:    2148348 total,   2136664 free
Timestamp of tree: Thu, 20 Nov 2014 09:00:01 +0000
ld GNU ld (Gentoo 2.24 p1.4) 2.24
ccache version 3.1.9 [enabled]
app-shells/bash:          4.2_p53
dev-lang/perl:            5.18.2-r2
dev-lang/python:          2.7.7, 3.2.5-r3, 3.3.5-r1, 3.4.1
dev-util/ccache:          3.1.9-r3
dev-util/cmake:           2.8.12.2-r1
dev-util/pkgconfig:       0.28-r1
sys-apps/baselayout:      2.2
sys-apps/openrc:          0.12.4
sys-apps/sandbox:         2.6-r1
sys-devel/autoconf:       2.69
sys-devel/automake:       1.13.4
sys-devel/binutils:       2.24-r3
sys-devel/gcc:            4.7.3-r1, 4.8.3
sys-devel/gcc-config:     1.7.3
sys-devel/libtool:        2.4.2-r1
sys-devel/make:           4.0-r1
sys-kernel/linux-headers: 3.16 (virtual/os-headers)
sys-libs/glibc:           2.19-r1
Repositories: gentoo x-portage
ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="* -@EULA"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-O2 -pipe"
DISTDIR="/usr/portage/distfiles"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs ccache config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync news parallel-fetch preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LANG="en_US.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j10"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
USE="acl amd64 bash-completion berkdb bindist bzip2 cli cracklib crypt cxx dri fortran gdbm iconv ipv6 logrotate mmx modules multilib ncurses nls nptl nptlonly openmp pae pam pcre readline session sse sse2 ssl tcpd unicode zlib" ABI_X86="64" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump author" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ublox ubx" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LINGUAS="it en" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-5" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7 python3_3" RUBY_TARGETS="ruby19 ruby20" USERLAND="GNU" VIDEO_CARDS="fbdev glint intel mach64 mga nouveau nv r128 radeon savage sis tdfx trident vesa via vmware dummy v4l" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, SYNC, USE_PYTHON
Comment 2 Daniele Palumbo 2014-11-20 16:31:45 UTC
Created attachment 389906 [details, diff]
initrd proposed patch
Comment 3 Daniele Palumbo 2014-11-20 16:32:24 UTC
Created attachment 389908 [details, diff]
xendomains needed changes to conf.d xendomains
Comment 4 Yixun Lan archtester gentoo-dev 2014-11-21 02:39:02 UTC
a) for problem not shutdown lvm guest which manually started
we had a similar bug 498720, was fixed bug >=xen-4.3, but as xen 4.2.x don't support "xl shutdown -a -w", so yes, it's buggy. and I tend to leave it as it is, but suggest you using >=4.3 above. we may eventually drop maintenance for xen-4.2

b) I have difficulty to understand what you try to achieve here? can you elaborate?

c) "screen not working" problem, I don't have experience with screen, so can't comment here, probably @idella4 can?
Comment 5 Yixun Lan archtester gentoo-dev 2014-11-21 02:53:27 UTC
by design, we decide not to shutdown 'manually started domU' in xendomains script, but in xenconsoled's stop(), which leaves xendomains only handle domU in /etc/xen/auto/
Comment 6 Daniele Palumbo 2014-11-23 23:33:00 UTC
Hi, 

thanks for the replies.
following further considerations/explaining for bugs.

a) Fine, still xendomains shouldn't DEPEND on xenconsoled?
and xenconsoled shouldn't ALWAYS run on shutdown (regardingless of xend?)?

b) suppose that you have a domain hanging on shutdown for any reason (ie: shutdown procedure not correct, not stopping service and try to unmount filesystem).
This will lead to infinite shutdown time, and also
        [ $V -gt 2 ] && xl shutdown -a -w >/dev/null
should be affect (still, i have not tested).

What should be done, imo, is wait for a given timeout (customizable), then xenconsoled/xendomains should destroy the failing domains.

So:
1) try to shutdown domain X
2) shutdown of domain X does not complete in Y seconds
3) destroy the domain X

I would say that this should be implemented on both init script, if even one of the 2 init does not complete, the procedure will hang the shutdown in any case.
One difference, if i choose to not parallelize shutdown (AFAIK i can still choose it in conf.d, right?), xendomains should wait for domain X to shutdown, then destroy, and only after that try to shut down another domain (ie: network filesystems)

c) i will provide examples if needed, still on xendomains startup, "screen -r" does not work (at least) for me.
i will try to list some of the problems:
- On boot, logging in as root, "screen -r" does not not work. that is why $HOME is not set on boot while screen start, screen -list will look in "/root/.screen/", while the "xen screen directory" will be "/.screen" 
- "-S ${SCREEN_NAME:=xen}", a sanity on dead screen is not done. the startup now wipe all the dead screens.
- Also, if the xen console already exist for any reason, nor an error or attching current session is made.

in the provided patch (of course to be reviews) there are some comments, related to exit status of screen command.

Thanks,
Daniele
Comment 7 Ian Delaney (RETIRED) gentoo-dev 2015-02-27 03:08:19 UTC
ok, this says  app-emulation/xen-tools-4.2. which we ought purge now since new versions have dropped support of hypervisor for x86.  The first patch is quitre a radical change.  Assume for a moment the 4.2 xens are gine. Does this still occur in >= 4.3?
Comment 8 Doug Goldstein (RETIRED) gentoo-dev 2016-12-20 04:16:36 UTC
Closing due to inactivity.