1 Index: python/Makefile-files
2 ===================================================================
3 --- python/Makefile-files (revision 2883)
4 +++ python/Makefile-files (revision 2908)
6 ## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
9 +AM_INSTALLCHECK_STD_OPTIONS_EXEMPT += python/libvserver.py
10 pyexec_LTLIBRARIES += python/_libvserver.la
11 pyexec_SCRIPTS += python/libvserver.py
12 python__libvserver_la_SOURCES = python/_libvserver.c
14 ===================================================================
15 --- debian/control (revision 0)
16 +++ debian/control (revision 2908)
21 +Maintainer: Daniel Hokka Zakrisson <daniel@hozac.com>
22 +Build-Depends: debhelper (>= 7), gawk, dietlibc-dev, net-tools, vlan, iptables, wget, procps, module-init-tools, libnss3-dev, po-debconf, e2fslibs-dev, pkg-config, python2.6-dev
23 +Standards-Version: 3.8.4
24 +Homepage: http://savannah.nongnu.org/projects/util-vserver/
26 +Package: util-vserver
28 +Depends: ${shlibs:Depends}, ${misc:Depends}, util-vserver-core, libvserver0, util-vserver-sysv, diffutils
29 +Description: utilities for managing Linux-VServer guests
30 + util-vserver provides the components and a framework to setup virtual
31 + servers. A virtual server runs inside a Linux server. It is nevertheless
32 + highly independent. As such, you can run various services with normal
33 + configuration. The various vservers can't interact with each other and
34 + can't interact with services in the main server.
39 +Depends: ${shlibs:Depends}, ${misc:Depends}
40 +Description: dynamic libraries for util-vserver
41 + util-vserver provides the components and a framework to setup virtual
42 + servers. A virtual server runs inside a Linux server. It is nevertheless
43 + highly independent. As such, you can run various services with normal
44 + configuration. The various vservers can't interact with each other and
45 + can't interact with services in the main server.
47 +Package: util-vserver-core
49 +Depends: ${shlibs:Depends}, ${misc:Depends}
50 +Description: core utilities of util-vserver
51 + util-vserver provides the components and a framework to setup virtual
52 + servers. A virtual server runs inside a Linux server. It is nevertheless
53 + highly independent. As such, you can run various services with normal
54 + configuration. The various vservers can't interact with each other and
55 + can't interact with services in the main server.
57 +Package: util-vserver-build
59 +Depends: ${shlibs:Depends}, ${misc:Depends}, util-vserver, wget, binutils
60 +Description: tools which can be used to build vservers
61 + util-vserver provides the components and a framework to setup virtual
62 + servers. A virtual server runs inside a Linux server. It is nevertheless
63 + highly independent. As such, you can run various services with normal
64 + configuration. The various vservers can't interact with each other and
65 + can't interact with services in the main server.
67 +Package: util-vserver-sysv
69 +Depends: ${shlibs:Depends}, ${misc:Depends}, util-vserver, make, diffutils
70 +Description: initscripts for util-vserver
71 + util-vserver provides the components and a framework to setup virtual
72 + servers. A virtual server runs inside a Linux server. It is nevertheless
73 + highly independent. As such, you can run various services with normal
74 + configuration. The various vservers can't interact with each other and
75 + can't interact with services in the main server.
77 +Package: util-vserver-legacy
79 +Depends: ${shlibs:Depends}, ${misc:Depends}, ${perl:Depends}, util-vserver
80 +Description: legacy scripts for util-vserver
81 + util-vserver provides the components and a framework to setup virtual
82 + servers. A virtual server runs inside a Linux server. It is nevertheless
83 + highly independent. As such, you can run various services with normal
84 + configuration. The various vservers can't interact with each other and
85 + can't interact with services in the main server.
87 +Package: libvserver0-dev
90 +Depends: ${shlibs:Depends}, ${misc:Depends}, libvserver0, pkg-config
91 +Description: headers and libraries needed to develop vserver based applications
92 + util-vserver provides the components and a framework to setup virtual
93 + servers. A virtual server runs inside a Linux server. It is nevertheless
94 + highly independent. As such, you can run various services with normal
95 + configuration. The various vservers can't interact with each other and
96 + can't interact with services in the main server.
98 +Package: util-vserver-python
100 +Depends: ${shlibs:Depends}, ${misc:Depends}, libvserver0, ${python:Depends}, ${python:Versions}
101 +Description: python-bindings for util-vserver
102 + util-vserver provides the components and a framework to setup virtual
103 + servers. A virtual server runs inside a Linux server. It is nevertheless
104 + highly independent. As such, you can run various services with normal
105 + configuration. The various vservers can't interact with each other and
106 + can't interact with services in the main server.
108 Property changes on: debian/control
109 ___________________________________________________________________
114 ===================================================================
115 --- debian/compat (revision 0)
116 +++ debian/compat (revision 2908)
119 Index: debian/util-vserver-build.postinst
120 ===================================================================
121 --- debian/util-vserver-build.postinst (revision 0)
122 +++ debian/util-vserver-build.postinst (revision 2908)
126 +test -d /vservers/.hash || mkdir -m0700 /vservers/.hash
128 +f="/etc/vservers/.defaults/apps/vunify/hash"; test -e "$f"/method -o -e "$f"/00 || \
129 + ln -s /vservers/.hash "$f"/00
131 +/usr/sbin/setattr --barrier /vservers/.hash || :
133 Property changes on: debian/util-vserver-build.postinst
134 ___________________________________________________________________
138 Index: debian/copyright
139 ===================================================================
140 --- debian/copyright (revision 0)
141 +++ debian/copyright (revision 2908)
143 +This work was packaged for Debian by:
145 + Daniel Hokka Zakrisson <daniel@hozac.com> on Wed, 14 Jul 2010 22:42:52 +0000
147 +It was downloaded from:
149 + http://svn.linux-vserver.org/svn/util-vserver
153 + Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
154 + Daniel Hokka Zakrisson <daniel@hozac.com>
158 + Copyright (C) 2002-2010 Enrico Scholz
159 + Copyright (C) 2006-2010 Daniel Hokka Zakrisson
163 + This program is free software; you can redistribute it and/or modify it
164 + under the terms of the GNU General Public License as published by the Free
165 + Software Foundation; version 2.
167 + This program is distributed in the hope that it will be useful, but
168 + WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
169 + or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
172 + You should have received a copy of the GNU General Public License with
173 + your Debian GNU system, in /usr/share/common-licenses/GPL-2, or with the
174 + Debian GNU source package as the file GNUGPL.TXT. If not, write to the
175 + Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
176 + MA 02110-1301, USA.
178 +The Debian packaging is:
180 + Copyright (C) 2010 Daniel Hokka Zakrisson <daniel@hozac.com>
182 +and is licensed under the GPL version 2,
183 +see "/usr/share/common-licenses/GPL-2".
185 ===================================================================
186 --- debian/docs (revision 0)
187 +++ debian/docs (revision 2908)
191 Index: debian/util-vserver.postinst
192 ===================================================================
193 --- debian/util-vserver.postinst (revision 0)
194 +++ debian/util-vserver.postinst (revision 2908)
198 +test -d /vservers || mkdir -m0000 /vservers
199 +test -d /vservers/.pkg || mkdir -m0755 /vservers/.pkg
201 +f="/etc/vservers/.defaults/vdirbase"; test -L "$f" -o -e "$f" || ln -s /vservers "$f"
202 +f="/etc/vservers/.defaults/run.rev"; test -L "$f" -o -e "$f" || ln -s /var/run/vservers.rev "$f"
203 +f="/etc/vservers/.defaults/cachebase"; test -L "$f" -o -e "$f" || ln -s /var/cache/vservers "$f"
205 +/usr/sbin/setattr --barrier /vservers /vservers/.pkg || :
207 Property changes on: debian/util-vserver.postinst
208 ___________________________________________________________________
213 ===================================================================
214 --- debian/rules (revision 0)
215 +++ debian/rules (revision 2908)
219 +# Sample debian/rules that uses debhelper.
221 +# This file was originally written by Joey Hess and Craig Small.
222 +# As a special exception, when this file is copied by dh-make into a
223 +# dh-make output file, you may use that output file without restriction.
224 +# This special exception was added by Craig Small in version 0.37 of dh-make.
226 +# Modified to make a template file for a multi-binary package with separated
227 +# build-arch and build-indep targets by Bill Allombert 2001
229 +# Uncomment this to turn on verbose mode.
230 +#export DH_VERBOSE=1
232 +# This has to be exported to make some magic below work.
239 +override_dh_auto_configure:
240 + dh_auto_configure -- --with-initrddir=/etc/init.d --enable-release \
241 + --enable-apis=NOLEGACY --with-initscripts=sysv
243 +override_dh_auto_test:
245 +override_dh_auto_install:
247 + contrib/make-deb-manifest util-vserver debian contrib/manifest.dat files
249 Property changes on: debian/rules
250 ___________________________________________________________________
256 Index: debian/util-vserver.postrm
257 ===================================================================
258 --- debian/util-vserver.postrm (revision 0)
259 +++ debian/util-vserver.postrm (revision 2908)
263 +if test "$1" = purge; then
264 + rm -rf /var/cache/vservers/* 2>/dev/null || :
267 Property changes on: debian/util-vserver.postrm
268 ___________________________________________________________________
272 Index: debian/util-vserver-legacy.postinst
273 ===================================================================
274 --- debian/util-vserver-legacy.postinst (revision 0)
275 +++ debian/util-vserver-legacy.postinst (revision 2908)
279 +if test "$1" = configure; then
280 + update-rc.d rebootmgr start 98 2 3 4 5 stop 02 0 1 6 .
281 + update-rc.d vservers-legacy start 98 2 3 4 5 stop 02 0 1 6 .
282 + for i in httpd named portmap sendmail smb sshd xinetd gated; do
283 + update-rc.d v_$i start 98 2 3 4 5 stop 02 0 1 6 .
287 Property changes on: debian/util-vserver-legacy.postinst
288 ___________________________________________________________________
292 Index: debian/util-vserver-sysv.postinst
293 ===================================================================
294 --- debian/util-vserver-sysv.postinst (revision 0)
295 +++ debian/util-vserver-sysv.postinst (revision 2908)
299 +if test "$1" = configure; then
300 + update-rc.d vservers-default start 98 2 3 4 5 stop 02 0 1 6 .
301 + update-rc.d vprocunhide start 26 2 3 4 5 stop 74 0 1 6 .
302 + update-rc.d util-vserver start 10 2 3 4 5 stop 90 0 1 6 .
305 Property changes on: debian/util-vserver-sysv.postinst
306 ___________________________________________________________________
310 Index: debian/changelog.in
311 ===================================================================
312 --- debian/changelog.in (revision 0)
313 +++ debian/changelog.in (revision 2908)
315 +util-vserver (@PACKAGE_VERSION@-1) unstable; urgency=low
319 + -- Daniel Hokka Zakrisson <daniel@hozac.com> @DATE@
320 Index: debian/util-vserver-sysv.postrm
321 ===================================================================
322 --- debian/util-vserver-sysv.postrm (revision 0)
323 +++ debian/util-vserver-sysv.postrm (revision 2908)
327 +if test "$1" = upgrade; then
328 + /etc/init.d/vprocunhide condrestart > /dev/null 2>&1
331 Property changes on: debian/util-vserver-sysv.postrm
332 ___________________________________________________________________
336 Index: debian/Makefile-files
337 ===================================================================
338 --- debian/Makefile-files (revision 0)
339 +++ debian/Makefile-files (revision 2908)
341 +## $Id$ -*- makefile -*-
343 +## Copyright (C) 2010 Daniel Hokka Zakrisson <daniel@hozac.com>
345 +## This program is free software; you can redistribute it and/or modify
346 +## it under the terms of the GNU General Public License as published by
347 +## the Free Software Foundation; either version 2, or (at your option)
348 +## any later version.
350 +## This program is distributed in the hope that it will be useful,
351 +## but WITHOUT ANY WARRANTY; without even the implied warranty of
352 +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
353 +## GNU General Public License for more details.
355 +## You should have received a copy of the GNU General Public License
356 +## along with this program; if not, write to the Free Software
357 +## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
361 +EXTRA_DIST += debian/rules \
366 + debian/changelog.in \
369 +#CLEANFILES += debian/changelog
371 +DEB_CL_DATE = $(shell date '+%a, %d %b %Y %H:%M:%S %z')
372 +debian/changelog: debian/changelog.in
373 + $(SED) "s/@"PACKAGE_VERSION"@/$(PACKAGE_VERSION)/g;s/@"DATE"@/$(DEB_CL_DATE)/g" $< > $@
375 Property changes on: debian/Makefile-files
376 ___________________________________________________________________
380 Index: debian/util-vserver-legacy.prerm
381 ===================================================================
382 --- debian/util-vserver-legacy.prerm (revision 0)
383 +++ debian/util-vserver-legacy.prerm (revision 2908)
387 +if test "$1" = remove; then
388 + /etc/init.d/rebootmgr stop > /dev/null 2>&1
389 + update-rc.d rebootmgr remove
390 + update-rc.d vservers-legacy remove
391 + for i in httpd named portmap sendmail smb sshd xinetd gated; do
392 + update-rc.d v_$i remove
396 Property changes on: debian/util-vserver-legacy.prerm
397 ___________________________________________________________________
401 Index: debian/util-vserver-sysv.prerm
402 ===================================================================
403 --- debian/util-vserver-sysv.prerm (revision 0)
404 +++ debian/util-vserver-sysv.prerm (revision 2908)
408 +if test "$1" = remove; then
409 + /etc/init.d/vprocunhide stop > /dev/null 2>&1
410 + update-rc.d vprocunhide remove
411 + update-rc.d util-vserver remove
412 + update-rc.d vservers-default remove
415 Property changes on: debian/util-vserver-sysv.prerm
416 ___________________________________________________________________
420 Index: src/testsuite/hashcalc-plain.c
421 ===================================================================
422 --- src/testsuite/hashcalc-plain.c (revision 2883)
423 +++ src/testsuite/hashcalc-plain.c (revision 2908)
428 +#include <sys/stat.h>
429 #include <sys/mman.h>
431 #define ENSC_TESTSUITE
432 Index: src/testsuite/Makefile-files
433 ===================================================================
434 --- src/testsuite/Makefile-files (revision 2883)
435 +++ src/testsuite/Makefile-files (revision 2908)
437 src/testsuite/hashcalc-plain.sh \
438 src/testsuite/vwait-test.sh
440 +DIETPROGS += src/testsuite/vunify-functest \
441 + src/testsuite/chcontext-test \
442 + src/testsuite/chbind-test \
443 + src/testsuite/rpm-fake-test
445 src_testsuite_rpm_fake_test_SOURCES = src/testsuite/rpm-fake-test.c
447 src_testsuite_vunify_functest_SOURCES = src/testsuite/vunify-functest.c
448 src_testsuite_vunify_functest_LDADD = $(LIBINTERNAL)
449 src_testsuite_vunify_functest_CPPFLAGS= $(AM_CPPFLAGS) $(src_testsuite_CPPFLAGS)
452 src_testsuite_chcontext_test_SOURCES = src/testsuite/chcontext-test.c
453 -src_testsuite_chcontext_test_LDADD = lib/libvserver.la $(LIBINTERNAL)
454 +src_testsuite_chcontext_test_LDADD = $(VSERVER_LDADDS) $(LIBINTERNAL)
457 src_testsuite_chbind_test_SOURCES = src/testsuite/chbind-test.c
458 -src_testsuite_chbind_test_LDADD = lib/libvserver.la
459 +src_testsuite_chbind_test_LDADD = $(LIBVSERVER)
461 src_testsuite_hashcalc_SOURCES = src/testsuite/hashcalc.c
462 src_testsuite_hashcalc_plain_SOURCES = src/testsuite/hashcalc-plain.c
464 src_testsuite_hashcalc_plain_CFLAGS = $(AM_CFLAGS) $(ENSC_CRYPTO_CFLAGS)
466 if ENSC_CAN_CRYPTO_WITH_DIETLIBC
467 +DIETPROGS += src/testsuite/hashcalc \
468 + src/testsuite/hashcalc-plain
470 src_testsuite_hashcalc_LDADD = $(LIBINTERNAL) $(LIBENSCVECTOR) $(ENSC_CRYPTO_LIB) $(VSERVER_LDADDS)
471 src_testsuite_hashcalc_LDFLAGS = $(VSERVER_LDFLGS)
473 Index: src/vcontext.c
474 ===================================================================
475 --- src/vcontext.c (revision 2883)
476 +++ src/vcontext.c (revision 2908)
481 +#include "compat-pivot_root.h"
482 #include "lib/internal.h"
483 #include "lib_internal/jail.h"
484 #include "lib_internal/sys_personality.h"
485 Index: src/vserver-stat.c
486 ===================================================================
487 --- src/vserver-stat.c (revision 2883)
488 +++ src/vserver-stat.c (revision 2908)
492 #include "internal.h"
493 +#include "pathconfig.h"
495 #include <ensc_vector/vector.h>
501 - "Show informations about all the active context.\n\n"
502 + "Show information about all active contexts.\n\n"
503 " CTX# Context number\n"
504 " #0 = root context\n"
505 " #1 = monitoring context\n"
506 @@ -279,6 +280,152 @@
511 +registerXidCgroups(struct Vector *vec, struct process_info *process)
513 + xid_t xid = (xid_t) process->s_context;
514 + struct XidData *res;
516 + switch (vc_getXIDType(xid)) {
517 + case vcTYPE_STATIC:
518 + case vcTYPE_DYNAMIC:
524 + res = Vector_search(vec, &xid, cmpData);
526 + struct vc_rlimit_stat limit;
527 + struct vc_virt_stat vstat;
528 + struct vc_sched_info sched;
535 + ssize_t cgroup_len;
536 + unsigned long long rss;
540 + if (vc_virt_stat(xid, &vstat) == -1) {
541 + perror("vc_virt_stat()");
544 + if (vc_rlimit_stat(xid, RLIMIT_NPROC, &limit) == -1) {
545 + perror("vc_rlimit_stat(RLIMIT_NRPOC)");
548 + if (vc_get_vhi_name(xid, vcVHI_CONTEXT, vhi_name, sizeof(vhi_name)) == -1) {
549 + perror("vc_get_vhi_name(CONTEXT)");
553 + if ((fd = open(DEFAULTCONFDIR "/cgroup/mnt", O_RDONLY)) == -1) {
554 + strcpy(cgroup, "/dev/cgroup/");
555 + cgroup_len = sizeof("/dev/cgroup");
558 + cgroup_len = read(fd, cgroup, sizeof(cgroup));
559 + if (cgroup_len == -1) {
560 + perror("read(cgroup/mnt)");
564 + cgroup[cgroup_len] = '/';
566 + cgroup[cgroup_len] = 0;
569 + len = strlen(vhi_name);
570 + if ((len + sizeof("/cgroup/name")) >= sizeof(filename)) {
571 + WRITE_MSG(2, "too long context name: ");
572 + WRITE_STR(2, vhi_name);
573 + WRITE_MSG(2, "\n");
576 + strcpy(filename, vhi_name);
577 + strcpy(filename + len, "/cgroup/name");
579 + if ((fd = open(filename, O_RDONLY)) == -1) {
580 + char *dir = strrchr(vhi_name, '/');
582 + WRITE_MSG(2, "invalid context name: ");
584 + WRITE_MSG(2, "\n");
588 + if ((len + cgroup_len) >= sizeof(cgroup)) {
589 + WRITE_MSG(2, "cgroup name too long: ");
591 + WRITE_MSG(2, "\n");
594 + strcpy(cgroup + cgroup_len, dir);
599 + ret = read(fd, cgroup + cgroup_len, sizeof(cgroup) - cgroup_len);
601 + perror("read(cgroup/name)");
608 + if ((cgroup_len + sizeof("/memory.usage_in_bytes")) > sizeof(filename)) {
609 + WRITE_MSG(2, "cgroup name too long: ");
610 + WRITE_STR(2, cgroup);
611 + WRITE_MSG(2, "\n");
614 + strcpy(filename, cgroup);
615 + strcpy(filename + cgroup_len, "/memory.usage_in_bytes");
617 + if ((fd = open(filename, O_RDONLY)) == -1) {
618 + perror("open(memory.usage_in_bytes)");
621 + if (read(fd, buf, sizeof(buf)) == -1) {
622 + perror("read(memory.usage_in_bytes)");
626 + if ((rss = strtoull(buf, &endptr, 0)) == ULLONG_MAX ||
627 + (*endptr != '\n' && *endptr != '\0')) {
628 + perror("strtoull(memory.usage_in_bytes)");
632 + res = Vector_insert(vec, &xid, cmpData);
635 + res->process_count = limit.value;
636 + res->VmRSS_total = rss / 4096;
637 + res->start_time_oldest= getUptime() - vstat.uptime/1000000;
639 + res->utime_total = 0;
640 + res->stime_total = 0;
641 + // XXX: arbitrary CPU limit.
642 + for (cpu = 0; cpu < 1024; cpu++) {
643 + sched.cpu_id = cpu;
644 + sched.bucket_id = 0;
645 + if (vc_sched_info(xid, &sched) == -1)
648 + res->utime_total += sched.user_msec;
649 + res->stime_total += sched.sys_msec;
653 + res->VmSize_total += process->VmSize;
656 static inline uint64_t
661 Vector_init(&xid_data, sizeof(struct XidData));
663 - if (vc_isSupported(vcFEATURE_VSTAT)) {
664 + if (vc_isSupported(vcFEATURE_VSTAT) && !vc_isSupported(vcFEATURE_MEMCG)) {
666 Echdir(PROC_VIRT_DIR_NAME);
667 proc_dir = Eopendir(".");
672 + void (*handler)(struct Vector *vec, struct process_info *process);
676 if (!switchToWatchXid(&errptr)) {
678 " procfs-security. Please read the FAQ for more details\n"
679 " http://linux-vserver.org/Proc-Security\n");
681 + if (vc_isSupported(vcFEATURE_MEMCG))
682 + handler = registerXidCgroups;
684 + handler = registerXid;
686 Echdir(PROC_DIR_NAME);
687 proc_dir = Eopendir(".");
688 while ((dir_entry = readdir(proc_dir)) != NULL)
690 if (atoi(dir_entry->d_name) != my_pid) {
691 struct process_info * info = get_process_info(dir_entry->d_name);
693 - registerXid(&xid_data, info);
694 + handler(&xid_data, info);
698 Index: scripts/vserver.suexec
699 ===================================================================
700 --- scripts/vserver.suexec (revision 2883)
701 +++ scripts/vserver.suexec (revision 2908)
704 $_EXEC_ULIMIT "$VSERVER_DIR/ulimits" \
705 ${USE_VNAMESPACE:+$_VNAMESPACE --enter "$S_CONTEXT" -- } \
706 - $_VSPACE --enter "$S_CONTEXT" "${OPTS_VSPACE[@]}" -- \
707 + $_VSPACE --enter "$S_CONTEXT" "${OPTS_VSPACE[@]}" "${OPTS_VSPACE_SHARED[@]}" -- \
708 $_VTAG --migrate "${OPTS_VTAG_ENTER[@]}" --silent -- \
709 $_VCONTEXT $SILENT_OPT --migrate $OPT_VCONTEXT_CHROOT \
710 --xid "$S_CONTEXT" --uid "$user" "${OPTS_VCONTEXT_ENTER[@]}" -- \
711 Index: scripts/vserver.stop
712 ===================================================================
713 --- scripts/vserver.stop (revision 2883)
714 +++ scripts/vserver.stop (revision 2908)
719 - "$_VSPACE" --enter "$S_CONTEXT" "${OPTS_VSPACE[@]}" -- \
720 + "$_VSPACE" --enter "$S_CONTEXT" "${OPTS_VSPACE[@]}" "${OPTS_VSPACE_SHARED[@]}" -- \
721 "$_VTAG" --migrate "${OPTS_VTAG_ENTER[@]}" --silent -- \
722 $_VCONTEXT $SILENT_OPT --migrate $OPT_VCONTEXT_CHROOT --xid "$S_CONTEXT" -- \
723 "${INITCMD_STOP[@]}" || fail=1
724 Index: scripts/vserver.start
725 ===================================================================
726 --- scripts/vserver.start (revision 2883)
727 +++ scripts/vserver.start (revision 2908)
729 if $_VSERVER_INFO - FEATURE migrate; then
732 + "${VSPACE_SHARED_CMD[@]}" \
734 $_EXEC_ULIMIT "$VSERVER_DIR"/ulimits \
735 $_VTAG --create "${OPTS_VTAG_CREATE[@]}" --silent -- \
737 $_VCONTEXT --create "${OPTS_VCONTEXT_CREATE[@]}" -- \
738 ${OPTION_STRACE:+$_STRACE -fF -o /tmp/vserver-start.$$} \
739 ${USE_VNAMESPACE:+$_VNAMESPACE --set -- } \
740 - $_VSPACE --set "${OPTS_VSPACE[@]}" -- \
741 + $_VSPACE --set "${OPTS_VSPACE[@]}" "${OPTS_VSPACE_SHARED[@]}" -- \
742 $_EXEC_REMOUNT /proc /sys -- \
743 $_VLIMIT --dir "$VSERVER_DIR"/rlimits --missingok -- \
744 $_VSCHED --xid self --force "${OPTS_VSCHED[@]}" -- \
745 Index: scripts/vserver.functions
746 ===================================================================
747 --- scripts/vserver.functions (revision 2883)
748 +++ scripts/vserver.functions (revision 2908)
750 declare -a OPTS_VTAG_ENTER=()
751 declare -a OPTS_VMEMCTRL=()
752 declare -a OPTS_VSPACE=( --default )
753 +declare -a OPTS_VSPACE_SHARED=()
754 +declare -a VSPACE_SHARED_CMD=()
756 declare -a STOPCMD_PREPARE=()
760 test -n "$_HAVE_INTERFACE_OPTIONS" || _generateInterfaceOptions "$vdir"
762 + if test -e "$vdir"/noncontext -o \
763 + \( -e "$vdir"/spaces/net -a ! -e "$vdir"/ncontext \); then
764 + _HAVE_CHBIND_OPTIONS=1
768 local f="$vdir"/interfaces/bcast
769 getFileValue bcast "$f"
770 f="$vdir"/interfaces/lback
771 @@ -787,17 +795,23 @@
774 local d="$vdir"/spaces
778 - ( test ! -e "$d"/pid ) || \
779 - OPTS_VSPACE=( "${OPTS_VSPACE[@]}" --pid )
780 + for space in pid net; do
781 + if test -e "$d"/$space; then
782 + getFileValue shared "$d"/$space || shared=""
783 + if test -z "$shared"; then
784 + OPTS_VSPACE=( "${OPTS_VSPACE[@]}" --$space )
785 + elif test "$shared" = "0"; then
788 + OPTS_VSPACE_SHARED=( "${OPTS_VSPACE_SHARED[@]}" --$space )
789 + VSPACE_SHARED_CMD=( "${VSPACE_SHARED_CMD[@]}" $_VSPACE --enter "$shared" --$space -- )
794 - test ! -e "$d"/net || {
795 - OPTS_VSPACE=( "${OPTS_VSPACE[@]}" --net )
796 - # network context and namespace don't make much sense
797 - _HAVE_CHBIND_OPTIONS=1
802 getFileValue mask "$d"/mask || \
803 OPTS_VSPACE=( "${OPTS_VSPACE[@]}" --mask "$mask" )
804 @@ -1461,8 +1475,12 @@
806 hasCgroup || return 1
807 test -d "$CGROUP_MNT" || return 1
809 + if $_VSERVER_INFO - FEATURE memcg; then
812 test -d "$1/cgroup" -o \
813 - \( -d "$__CONFDIR/.defaults/cgroup" -a \
814 + \( \( -d "$__CONFDIR/.defaults/cgroup" -o -n "$memcg" \) -a \
815 ! -e "$1/nocgroup" \)
819 ===================================================================
820 --- configure.ac (revision 2883)
821 +++ configure.ac (revision 2908)
823 AC_INIT(util-vserver, 0.30.215, vserver@list.linux-vserver.org)
824 AC_CONFIG_SRCDIR([src/capchroot.c])
825 AC_CONFIG_HEADER([config.h])
826 +AC_CONFIG_MACRO_DIR([m4])
828 AM_INIT_AUTOMAKE([1.9 gnits dist-bzip2 subdir-objects])
830 Index: lib/syscall_setiattr-fscompat.hc
831 ===================================================================
832 --- lib/syscall_setiattr-fscompat.hc (revision 2883)
833 +++ lib/syscall_setiattr-fscompat.hc (revision 2908)
835 #include "ioctl-getxflg.hc"
838 +#include <sys/stat.h>
840 static inline ALWAYSINLINE int
841 vc_set_iattr_fscompat(char const *filename,
843 ===================================================================
844 --- lib/vserver.h (revision 2883)
845 +++ lib/vserver.h (revision 2908)
848 // the VCI bit values
849 #define VC_VCI_NO_DYNAMIC (1 << 0)
850 +#define VC_VCI_PROC_SECURE (1 << 4)
851 +#define VC_VCI_HARDCPU (1 << 5)
852 +#define VC_VCI_IDLELIMIT (1 << 6)
853 +#define VC_VCI_IDLETIME (1 << 7)
854 +#define VC_VCI_COWBL (1 << 8)
855 +#define VC_VCI_FULLCOWBL (1 << 9)
856 #define VC_VCI_SPACES (1 << 10)
857 #define VC_VCI_NETV2 (1 << 11)
858 +#define VC_VCI_MEMCG (1 << 12)
859 +#define VC_VCI_DEBUG (1 << 16)
860 +#define VC_VCI_HISTORY (1 << 20)
861 +#define VC_VCI_TAGGED (1 << 24)
862 #define VC_VCI_PPTAG (1 << 28)
866 vcFEATURE_VSHELPER0, vcFEATURE_VSHELPER, vcFEATURE_VWAIT,
867 vcFEATURE_VNET, vcFEATURE_VSTAT, vcFEATURE_PPTAG,
868 vcFEATURE_PIDSPACE, vcFEATURE_SPACES, vcFEATURE_PERSISTENT,
869 - vcFEATURE_PIVOT_ROOT,
870 + vcFEATURE_PIVOT_ROOT, vcFEATURE_MEMCG,
874 Index: lib/issupported.c
875 ===================================================================
876 --- lib/issupported.c (revision 2883)
877 +++ lib/issupported.c (revision 2908)
879 case vcFEATURE_PPTAG : return conf & VC_VCI_PPTAG;
880 case vcFEATURE_SPACES : return conf & VC_VCI_SPACES;
881 case vcFEATURE_PIVOT_ROOT : return ver >= 0x00020304;
882 - case vcFEATURE_PIDSPACE : return ver >= 0x00020305;
883 + case vcFEATURE_PIDSPACE : return false;
884 + case vcFEATURE_MEMCG : return ver >= 0x00020306 && conf & VC_VCI_MEMCG;
885 default : assert(false);
888 Index: lib/syscall_getiattr-fscompat.hc
889 ===================================================================
890 --- lib/syscall_getiattr-fscompat.hc (revision 2883)
891 +++ lib/syscall_getiattr-fscompat.hc (revision 2908)
893 #include "ioctl-getxflg.hc"
897 +#include <sys/stat.h>
899 static inline ALWAYSINLINE int
900 vc_get_iattr_fscompat(char const *filename,
901 xid_t * /*@null@*/ xid,
902 Index: lib/issupportedstring.c
903 ===================================================================
904 --- lib/issupportedstring.c (revision 2883)
905 +++ lib/issupportedstring.c (revision 2908)
907 DECL(MIGRATE), DECL(NAMESPACE), DECL(SCHED), DECL(VINFO),
908 DECL(VHI), DECL(VSHELPER0), DECL(VSHELPER), DECL(VWAIT),
909 DECL(VNET), DECL(VSTAT), DECL(PPTAG), DECL(PIDSPACE),
910 - DECL(SPACES), DECL(PERSISTENT),DECL(PIVOT_ROOT),
911 + DECL(SPACES), DECL(PERSISTENT),DECL(PIVOT_ROOT),DECL(MEMCG),
915 Index: pathconfig.h.pathsubst
916 ===================================================================
917 --- pathconfig.h.pathsubst (revision 2883)
918 +++ pathconfig.h.pathsubst (revision 2908)
920 #define SYSCONFDIR "@SYSCONFDIR@"
921 #define LOCKDIR "/var/lock"
922 #define PKGLIBDEFAULTDIR PKGLIBDIR "/defaults"
923 +#define DEFAULTCONFDIR "@CONFDIR@/.defaults"
925 #define DEFAULT_VSERVERDIR "@VSERVERDIR@"
926 #define DEFAULT_VSERVERPKGDIR "@VSERVERPKGDIR@"
927 Index: contrib/make-manifest
928 ===================================================================
929 --- contrib/make-manifest (revision 2883)
930 +++ contrib/make-manifest (revision 2908)
935 -for i in $name-{core,devel,base,build,legacy,lib,sysv}.list; do
936 +for i in $name-{core,devel,base,build,legacy,lib,sysv,python}.list; do
937 echo '%defattr(-,root,root,-)' >$i
940 Index: contrib/manifest.dat.pathsubst
941 ===================================================================
942 --- contrib/manifest.dat.pathsubst (revision 2883)
943 +++ contrib/manifest.dat.pathsubst (revision 2908)
945 legacy @CONFIG@ @INITRDDIR@/vservers-legacy
946 legacy @CONFIG_NOREPLACE@ @SYSCONFDIR@/vservers.conf
947 build @CONFIG_NOREPLACE@ @CONFDIR@/.distributions/*/apt/sources.list
948 +@HAVE_PYTHON_TRUE@python @PYEXECDIR@/*
949 Index: contrib/make-deb-manifest
950 ===================================================================
951 --- contrib/make-deb-manifest (revision 0)
952 +++ contrib/make-deb-manifest (revision 2908)
956 +# Copyright (C) 2010 Daniel Hokka Zakrisson <daniel@hozac.com>
958 +# This program is free software; you can redistribute it and/or modify
959 +# it under the terms of the GNU General Public License as published by
960 +# the Free Software Foundation; version 2 of the License.
962 +# This program is distributed in the hope that it will be useful,
963 +# but WITHOUT ANY WARRANTY; without even the implied warranty of
964 +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
965 +# GNU General Public License for more details.
967 +# You should have received a copy of the GNU General Public License
968 +# along with this program; if not, write to the Free Software
969 +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
971 +## Usage: make-deb-manifest <basename> <destdir> <datfile>
978 + if test $1 = "lib"; then
979 + fullname="$dest/libvserver0"
980 + elif test $1 = "devel"; then
981 + fullname="$dest/libvserver0-dev"
982 + elif test $1 = "base"; then
985 + fullname="$name-$1"
989 +for i in {core,build,legacy,sysv,lib,devel,base,python}; do
991 + echo -n >${fullname}.install
992 + rm -f ${fullname}.conffiles
996 +while read style file; do
997 + test "$file" || continue
1005 + if test "$2"; then
1007 + for i in ${DESTDIR}$file; do
1008 + test "${file#/etc/}" != "$file" && continue
1009 + echo "${i#${DESTDIR}}" >>${fullname}.conffiles
1012 + for i in ${DESTDIR}$file; do
1014 + echo "$i ${i%/*}" >>${fullname}.install
1018 Property changes on: contrib/make-deb-manifest
1019 ___________________________________________________________________
1020 Name: svn:executable
1023 Index: contrib/Makefile-files
1024 ===================================================================
1025 --- contrib/Makefile-files (revision 2883)
1026 +++ contrib/Makefile-files (revision 2908)
1028 contrib/yum-3.2.0-chroot.patch \
1029 contrib/yum-3.2.1-chroot.patch \
1030 contrib/yum-3.2.4-chroot.patch \
1031 - contrib/make-manifest
1032 + contrib/make-manifest \
1033 + contrib/make-deb-manifest
1035 contrib/manifest.dat: contrib/.manifest.dat.pathsubst.stamp
1036 Index: lib_internal/matchlist-initrefserverlist.c
1037 ===================================================================
1038 --- lib_internal/matchlist-initrefserverlist.c (revision 2883)
1039 +++ lib_internal/matchlist-initrefserverlist.c (revision 2908)
1044 +#include <sys/stat.h>
1046 #define ENSC_WRAPPERS_FCNTL 1
1047 #define ENSC_WRAPPERS_UNISTD 1
1048 Index: util-vserver.spec.in
1049 ===================================================================
1050 --- util-vserver.spec.in (revision 2883)
1051 +++ util-vserver.spec.in (revision 2908)
1052 @@ -395,9 +395,10 @@
1053 %{!?_without_doc:%doc lib/apidoc/html}
1057 +%if 0%{!?_without_python:1}
1058 +%files python -f %name-python.list
1059 %defattr(-,root,root,-)
1060 -%{!?_without_python:%{python_sitearch}/*}
1066 ===================================================================
1067 --- Makefile.am (revision 2883)
1068 +++ Makefile.am (revision 2908)
1070 s!@'ENSC_HAVE_C99_COMPILER_FALSE'@!\@ENSC_HAVE_C99_COMPILER_FALSE@ !g; \
1071 s!@'ENSC_HAVE_CXX_COMPILER_TRUE'@!\@ENSC_HAVE_CXX_COMPILER_TRUE@ !g; \
1072 s!@'ENSC_HAVE_CXX_COMPILER_FALSE'@!\@ENSC_HAVE_CXX_COMPILER_FALSE@ !g; \
1073 + s!@'HAVE_PYTHON_TRUE'@!\@HAVE_PYTHON_TRUE@ !g; \
1074 + s!@'HAVE_PYTHON_FALSE'@!\@HAVE_PYTHON_FALSE@ !g; \
1075 + s!@'PYEXECDIR'@!$(pyexecdir)!g; \
1076 $(ENSC_PATHPROG_SED)
1078 pathconfig.h: .pathconfig.h.pathsubst.stamp
1081 include $(top_srcdir)/python/Makefile-files
1083 +include $(top_srcdir)/debian/Makefile-files
1085 include $(top_srcdir)/m4/gpgsig.am
1086 include $(top_srcdir)/m4/validate.am
1087 Index: ensc_vector/testsuite/Makefile-files
1088 ===================================================================
1089 --- ensc_vector/testsuite/Makefile-files (revision 2883)
1090 +++ ensc_vector/testsuite/Makefile-files (revision 2908)
1092 TESTS += ensc_vector/testsuite/test1 \
1093 ensc_vector/testsuite/test2
1095 +DIETPROGS += ensc_vector/testsuite/test1 \
1096 + ensc_vector/testsuite/test2
1098 ensc_vector_testsuite_test1_SOURCES = ensc_vector/testsuite/test1.c
1099 ensc_vector_testsuite_test1_LDADD = $(LIBENSCVECTOR)