Ian Campbell
2014-Aug-31 00:38 UTC
[Pkg-xen-devel] Bug#444000: [ijc@hellion.org.uk: move core dumps to /var/lib/xen/dump]
This should have gone here and not to #706233. Patch will obviously need rebasing by now... ----- Forwarded message from Ian Campbell <ijc at hellion.org.uk> ----- Date: Fri, 16 Aug 2013 14:56:49 +0100 From: Ian Campbell <ijc at hellion.org.uk> To: 706233 at bugs.debian.org Cc: control at bugs.debian.org Subject: move core dumps to /var/lib/xen/dump X-Spam-Status: No, score=-4.9 required=4.0 tests=BAYES_00,DIGITS_LETTERS, FOURLA,MURPHY_DRUGS_REL8,VALID_BTS_CONTROL autolearn=ham version=3.3.2-bugs.debian.org_2005_01_02 tags 706233 +patch thanks This is somewhat more FHS compliant IMHO. commit 7d171826bc97bf5f3f2019fc32c1ca85b49de7c9 Author: Ian Campbell <ijc at hellion.org.uk> Date: Fri Aug 16 14:54:42 2013 +0100 * debian/patches/tools-core-dump-dir.patch: Switch tools to dumping to /var/log/xen/dump by default. * debian/xen-utils-common.dirs: Ensure /var/lib/xen/dump is created * debian/changelog: Update * debian/patches/series: Add new patch diff --git a/xen/debian/changelog b/xen/debian/changelog index 6100e75..ace8ad4 100644 --- a/xen/debian/changelog +++ b/xen/debian/changelog @@ -1,5 +1,6 @@ xen (4.3.0-1) UNRELEASED; urgency=low + [ Bastian Blank ] * New upstream release. * Call configure with proper arguments. * Remove now empty xen-docs package. @@ -16,6 +17,9 @@ xen (4.3.0-1) UNRELEASED; urgency=low - Fix fallout from harderning flags. * Update Standards-Version to 3.9.4. No changes. + [ Ian Campbell ] + * Put core dumps in /var/lib/xen/dump and ensure it exists (Closes: #444000) + -- Bastian Blank <waldi at debian.org> Tue, 23 Jul 2013 12:45:27 +0200 xen (4.2.2-1) unstable; urgency=low diff --git a/xen/debian/patches/series b/xen/debian/patches/series index 6af353f..858315b 100644 --- a/xen/debian/patches/series +++ b/xen/debian/patches/series @@ -54,3 +54,4 @@ tools-python-shebang.diff tools-ocaml-fix-build.diff tools-xenstore-compatibility.diff +tools-core-dump-dir.patch diff --git a/xen/debian/patches/tools-core-dump-dir.patch b/xen/debian/patches/tools-core-dump-dir.patch new file mode 100644 index 0000000..4cd0ea2 --- /dev/null +++ b/xen/debian/patches/tools-core-dump-dir.patch @@ -0,0 +1,67 @@ +Index: xen/docs/man/xl.cfg.pod.5 +==================================================================+--- xen.orig/docs/man/xl.cfg.pod.5 2013-07-09 11:46:56.000000000 +0100 ++++ xen/docs/man/xl.cfg.pod.5 2013-08-16 14:47:07.896315178 +0100 +@@ -242,12 +242,12 @@ + + =item B<coredump-destroy> + +-write a "coredump" of the domain to F</var/xen/dump/NAME> and then ++write a "coredump" of the domain to F</var/lib/xen/dump/NAME> and then + destroy the domain. + + =item B<coredump-restart> + +-write a "coredump" of the domain to F</var/xen/dump/NAME> and then ++write a "coredump" of the domain to F</var/lib/xen/dump/NAME> and then + restart the domain. + + =back +Index: xen/tools/Makefile +==================================================================+--- xen.orig/tools/Makefile 2013-08-16 14:45:07.841109329 +0100 ++++ xen/tools/Makefile 2013-08-16 14:47:42.360087203 +0100 +@@ -58,7 +58,7 @@ + + .PHONY: install + install: subdirs-install +- $(INSTALL_DIR) $(DESTDIR)/var/xen/dump ++ $(INSTALL_DIR) $(DESTDIR)/var/lib/xen/dump/ + $(INSTALL_DIR) $(DESTDIR)/var/log/xen + $(INSTALL_DIR) $(DESTDIR)/var/lib/xen + $(INSTALL_DIR) $(DESTDIR)/var/lock/subsys +Index: xen/tools/libxl/xl_cmdimpl.c +==================================================================+--- xen.orig/tools/libxl/xl_cmdimpl.c 2013-07-09 11:46:56.000000000 +0100 ++++ xen/tools/libxl/xl_cmdimpl.c 2013-08-16 14:47:31.040162084 +0100 +@@ -1591,7 +1591,7 @@ + char *corefile; + int rc; + +- if (asprintf(&corefile, "/var/xen/dump/%s", d_config->c_info.name) < 0) { ++ if (asprintf(&corefile, "/var/lib/xen/dump/%s", d_config->c_info.name) < 0) { + LOG("failed to construct core dump path"); + } else { + LOG("dumping core to %s", corefile); +Index: xen/tools/python/xen/xend/XendDomainInfo.py +==================================================================+--- xen.orig/tools/python/xen/xend/XendDomainInfo.py 2013-08-16 14:45:07.725110096 +0100 ++++ xen/tools/python/xen/xend/XendDomainInfo.py 2013-08-16 14:48:11.119896959 +0100 +@@ -2283,7 +2283,7 @@ + # To prohibit directory traversal + based_name = os.path.basename(self.info['name_label']) + +- coredir = "/var/xen/dump/%s" % (based_name) ++ coredir = "/var/lib/xen/dump/%s" % (based_name) + if not os.path.exists(coredir): + try: + mkdir.parents(coredir, stat.S_IRWXU) +@@ -2292,7 +2292,7 @@ + + if not os.path.isdir(coredir): + # Use former directory to dump core +- coredir = '/var/xen/dump' ++ coredir = '/var/lib/xen/dump/' + + this_time = time.strftime("%Y-%m%d-%H%M.%S", time.localtime()) + corefile = "%s/%s-%s.%s.core" % (coredir, this_time, diff --git a/xen/debian/xen-utils-common.dirs b/xen/debian/xen-utils-common.dirs index c745c08..a598c47 100644 --- a/xen/debian/xen-utils-common.dirs +++ b/xen/debian/xen-utils-common.dirs @@ -1 +1,2 @@ var/lib/xen +var/lib/xen/dump ----- End forwarded message -----