debian/0000775000000000000000000000000012322667251007176 5ustar debian/cgmanager-utils.dirs0000664000000000000000000000001012317626565013141 0ustar usr/bin debian/watch0000664000000000000000000000012112317626565010230 0ustar version=3 http://cgmanager.linuxcontainers.org/downloads cgmanager-(.*)\.tar\.gz debian/libcgmanager0.install0000664000000000000000000000003012317626565013261 0ustar lib/*/libcgmanager.so.* debian/cgmanager.cgproxy.upstart0000664000000000000000000000152712322666675014256 0ustar description "cgroup management proxy" author "Serge Hallyn " respawn expect stop emits cgmanager-ready # in trusty /sys/fs/cgroup will be mounted for us. # prior to saucy, we would need to start on mounted # MOUNTPOINT=/sys, and mount /sys/fs/cgroup ourselves start on started cgmanager stop on runlevel [06] # to get debug output into /var/log/upstart/cgproxy.log, create/edit # /etc/default/cgmanager and set cgmanager_opts="--debug" env cgmanager_opts="" env NESTED="no" pre-start script # check whether we should start if [ -e /proc/self/ns/pid ] && [ "$NESTED" = "no" ]; then initctl emit -n cgmanager-ready { stop; exit 0; } fi end script script [ -r /etc/default/cgmanager ] && . /etc/default/cgmanager exec /sbin/cgproxy --sigstop $cgmanager_opts end script post-start exec initctl emit -n cgmanager-ready debian/source/0000775000000000000000000000000012317653305010475 5ustar debian/source/format0000664000000000000000000000001412317626565011713 0ustar 3.0 (quilt) debian/copyright0000664000000000000000000000437012317626565011144 0ustar Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Upstream-Name: cgmanager Upstream-Contact: cgmanager-devel@lists.linuxcontainers.org Source: http://cgmanager.linuxcontainers.org/downloads Files: * Copyright: 2013-2014 Stéphane Graber 2013-2014 Serge Hallyn 2014 James Hunt 2014 S.Çağlar Onur License: GPL-2 Files: access_checks.c access_checks.h fs.c fs.h Copyright: 2013-2014 Serge Hallyn 2007-2008 IBM Corp. License: LGPL-2.1+ License: GPL-2 This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. . This package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. . You should have received a copy of the GNU General Public License along with this program. If not, see . On Debian systems, the complete text of the GNU General Public License version 2 can be found in "/usr/share/common-licenses/GPL-2". License: LGPL-2.1+ This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. . This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. . You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . On Debian systems, the full text of the GNU Lesser General Public License version 2.1 can be found in the file `/usr/share/common-licenses/LGPL-2.1'. debian/changelog0000664000000000000000000002720312322667243011055 0ustar cgmanager (0.24-0ubuntu5) trusty; urgency=medium * Add a 'stop on' to the upstart jobs (LP: #1307008) -- Serge Hallyn Mon, 14 Apr 2014 00:13:44 -0500 cgmanager (0.24-0ubuntu4) trusty; urgency=medium * debian/control: drop Vcs-Git field, which was pointing to the upstream branch, not packaging branch. -- Serge Hallyn Wed, 09 Apr 2014 23:13:03 -0500 cgmanager (0.24-0ubuntu3) trusty; urgency=medium * Use SIGSTOP as a way to tell upstart that we are ready to accept queries, this fixes a race condition. (LP: #1302174) * Emit cgmanager-ready once all the required daemons have been spawned and are ready for requests. (LP: #1302174) * Always kill cgproxy when spawning cgmanager, this is required to allow proper restart/respawning on systems using both daemons. (LP: #1302174) -- Stéphane Graber Fri, 04 Apr 2014 21:04:43 -0400 cgmanager (0.24-0ubuntu2) trusty; urgency=medium [ Serge Hallyn ] * move libraries from /usr/lib into /lib (LP: #1301544) * debian/control: - remove ${shlibs:Depends} from cgmanager-utils, cgmanager-tests and libcgmanager-devel * Makefile.am: - add -shared to AM_LDFLAGS - add AM_LDFLAGS to libcgmanager's ldflags [ Stéphane Graber ] * Add adt support. -- Serge Hallyn Wed, 02 Apr 2014 13:59:03 -0500 cgmanager (0.24-0ubuntu1) trusty; urgency=medium * Sync upstream relase v0.24 - Includes RemoveOnEmpty method (LP: #1281683) -- Serge Hallyn Mon, 31 Mar 2014 14:00:53 -0500 cgmanager (0.23-0ubuntu2) trusty; urgency=medium * debian/control: fix description of cgmanager-utils package. * debian/*.upstart: hard-code /sbin/ into the exec paths to avoid accidentally running old binaries not shipped with the package. * libcgmanager-dev.install: install libcgmanager.so -- Serge Hallyn Tue, 25 Mar 2014 10:15:14 -0500 cgmanager (0.23-0ubuntu1) trusty; urgency=medium * Pull upstream release v0.23 - all patches are upstream, drop from debian/patches/ - fix memory leak in scm handlers (LP: #1296804) - add a simple to use client tool (LP: #1295227) * debian/control: fix weak library dev dependency. * add cgmanager-utils package containing cgm client script -- Serge Hallyn Mon, 24 Mar 2014 11:56:04 -0500 cgmanager (0.20-0ubuntu5) trusty; urgency=medium * proxy: reconnect to cgmanager after disconnection (LP: #1294419) * print function name in most error messages -- Serge Hallyn Wed, 19 Mar 2014 00:18:56 -0500 cgmanager (0.20-0ubuntu4) trusty; urgency=medium * d/p/0003-set_value-only-check-write-access-rights.patch: fix wrong refusals to set cgroup values (LP: #1293647) -- Serge Hallyn Mon, 17 Mar 2014 11:38:19 -0500 cgmanager (0.20-0ubuntu3) trusty; urgency=medium * Implement ListChildren method to list child cgroups (LP: #1285900) -- Serge Hallyn Thu, 27 Feb 2014 16:51:30 -0600 cgmanager (0.20-0ubuntu2) trusty; urgency=medium * limit depth of cgroups (LP: #1284872) -- Serge Hallyn Wed, 26 Feb 2014 10:41:27 -0600 cgmanager (0.20-0ubuntu1) trusty; urgency=medium * Merge upstream v0.20 -- Serge Hallyn Mon, 24 Feb 2014 16:38:37 -0600 cgmanager (0.19-0ubuntu7) trusty; urgency=medium * 0006-cgproxy-remove-proxydir-if-it-exists.patch - this fixes startup of the proxy on the host itself, which is needed on older kernels. (update it to rmdir rather than unlink the directory) -- Serge Hallyn Fri, 21 Feb 2014 23:41:54 -0600 cgmanager (0.19-0ubuntu6) trusty; urgency=medium * 0005-allow-passing-in-extra-mounts.patch * debian/cgmanager.cgmanager.upstart: add '-m name=systemd' to mount the systemd cgroup for logind's use. -- Serge Hallyn Mon, 17 Feb 2014 16:48:14 -0600 cgmanager (0.19-0ubuntu5) trusty; urgency=medium * debian/control: add dependency on libdbus-1-dev to libcgmanager-dev -- Serge Hallyn Thu, 13 Feb 2014 15:06:34 -0600 cgmanager (0.19-0ubuntu4) trusty; urgency=medium * debian/rules: make sure to create m4 before calling autoreconf. * debian/control: make libcgmanager-dev Depend on nih-dbus-tool and libcgmanager0 * debian/cgmanager.cgmanager.upstart: also start on virtual-filesystems so as to start correctly in precise. -- Serge Hallyn Thu, 06 Feb 2014 16:27:15 -0600 cgmanager (0.19-0ubuntu3) trusty; urgency=medium * add 0004-add-.spec-for-rpm-build-minor-packaging-fixes.patch to move include file to /usr/include/cgmanager * debian/rules: don't hand-install pkgconfig * libcgmanager-dev.install: fix location of pkgconfig and /usr/include/cgmanager. -- Serge Hallyn Wed, 05 Feb 2014 15:40:35 -0600 cgmanager (0.19-0ubuntu2) trusty; urgency=medium * add upstream patch 0003-proxy-support-running-in-top-namespace.patch so proxy can run in initial namespace on old kernels * add cgproxy upstart job to run on host on old kernels, thanks to stgraber. -- Serge Hallyn Wed, 05 Feb 2014 10:40:07 -0600 cgmanager (0.19-0ubuntu1) trusty; urgency=medium * Merge upstream v0.19 * Add upstream patch to introduce manual pages. -- Serge Hallyn Mon, 03 Feb 2014 16:50:26 -0600 cgmanager (0.18-0ubuntu1) trusty; urgency=medium * Merge upstream v0.18. -- Serge Hallyn Fri, 31 Jan 2014 15:04:29 +0000 cgmanager (0.17-0ubuntu2) trusty; urgency=medium * cherrypick d/p/0001-cgmanager_chown-pass-a-valid-pid.patch from upstream to fix broken chown through proxy. -- Serge Hallyn Tue, 28 Jan 2014 17:28:35 +0000 cgmanager (0.17-0ubuntu1) trusty; urgency=medium * Merge upstream 0.17. -- Serge Hallyn Tue, 28 Jan 2014 10:58:02 +0000 cgmanager (0.16-0ubuntu3) trusty; urgency=medium * d/p/0006-hostuid_to_ns-don-t-dabble-with-1-uid_ts.patch. This also allows root in a user ns to chown a cgroup owned by a uid mapped into the namespace. -- Serge Hallyn Fri, 24 Jan 2014 00:04:58 -0600 cgmanager (0.16-0ubuntu2) trusty; urgency=medium * Add patches from upstream; particularly to more robustly handle nih_errors. -- Serge Hallyn Thu, 23 Jan 2014 18:31:04 -0600 cgmanager (0.16-0ubuntu1) trusty; urgency=medium * Initial upload to the archive * Merge upstream v0.16. - change &existed return value in create and remove methods: "no" is now -1 not 0. -- Serge Hallyn Mon, 20 Jan 2014 18:46:11 -0600 cgmanager (0.15-3) trusty; urgency=medium * upstart: - fix syntax error - optionally call /etc/default/cgmanager to source options (namely --debug) * 0004-formality-explicitly-call-existed-an-int32_t.patch -- Serge Hallyn Fri, 17 Jan 2014 12:17:08 -0600 cgmanager (0.15-2) trusty; urgency=medium * Add patches from upstream: - 0001-Fixes-for-Coverity-identified-issues.patch - 0002-address-pid-wraparound-in-hostuid_to_ns.patch - 0003-set_value-start-a-trivial-files-blacklist.patch -- Serge Hallyn Fri, 17 Jan 2014 11:35:22 -0600 cgmanager (0.15-1) trusty; urgency=medium [ Serge Hallyn ] * Merge new upstream tag 0.15 * d/cgmanager.upstart: don't rely on dbus-send [ Stéphane Graber] * fix lintian errors * fix licensing -- Serge Hallyn Fri, 17 Jan 2014 10:05:07 -0600 cgmanager (0.14-2) trusty; urgency=medium * define a -dbg package. -- Serge Hallyn Thu, 16 Jan 2014 14:22:45 -0600 cgmanager (0.14-1) trusty; urgency=medium * Merge new upstream tag 0.14, with lots of bugfixes. All tests now pass on host and in a userns container through proxy. -- Serge Hallyn Thu, 16 Jan 2014 12:28:02 -0600 cgmanager (0.13-1) trusty; urgency=medium * merge new upstream tag 0.13. * This implements Remove. -- Serge Hallyn Tue, 14 Jan 2014 17:26:47 -0600 cgmanager (0.12-1) trusty; urgency=medium * merge new upstream tag 0.12. * add a 'existed' output paramater to Create and CreateScm methods. -- Serge Hallyn Tue, 14 Jan 2014 13:18:58 -0600 cgmanager (0.11-5) trusty; urgency=medium * d/p/0001-add-CreateExclusive-method.patch: add CreateExclusive which fails if the requested cgroup exists. -- Serge Hallyn Mon, 13 Jan 2014 20:18:17 -0600 cgmanager (0.11-4) trusty; urgency=medium * install libcgmanager.pc and cgmanager.h -- Serge Hallyn Mon, 13 Jan 2014 16:02:36 -0600 cgmanager (0.11-3) trusty; urgency=medium * fix typo in upstart script (s/bin/sbin/) -- Serge Hallyn Mon, 13 Jan 2014 15:47:04 -0600 cgmanager (0.11-2) trusty; urgency=medium * d/libcgmanager-dev.install: fix the destination path for libcgmanager.h -- Serge Hallyn Mon, 13 Jan 2014 13:40:59 -0600 cgmanager (0.11-1) trusty; urgency=medium * Merge new upstream tag 0.11, which removes the &ok dbus parameter. -- Serge Hallyn Mon, 13 Jan 2014 12:08:52 -0600 cgmanager (0.10-2) trusty; urgency=medium * upstart: don't run if cgmanager has been removed. -- Serge Hallyn Fri, 10 Jan 2014 23:06:56 -0600 cgmanager (0.10-1) trusty; urgency=medium * Merge new upstream tag 0.10. -- Serge Hallyn Fri, 10 Jan 2014 16:20:00 -0600 cgmanager (0.03-4) trusty; urgency=medium * make tests executable -- Serge Hallyn Wed, 08 Jan 2014 13:28:15 -0600 cgmanager (0.03-3) trusty; urgency=medium * Install tests and libcgmanager.pc. -- Serge Hallyn Wed, 08 Jan 2014 11:09:03 -0600 cgmanager (0.03-2) trusty; urgency=medium * Fix upstart job to handle set -e. -- Serge Hallyn Tue, 07 Jan 2014 14:49:16 -0600 cgmanager (0.03-1) trusty; urgency=medium * Re-sync github tree, remove quilt patches * Move cgmanager socket to /sys/ * Add upstart job. -- Serge Hallyn Tue, 07 Jan 2014 13:21:39 -0600 cgmanager (0.02-2) trusty; urgency=medium * add upstream patch to move cgmanager to sbin * d/rules: set prefix to / * d/cgmanager.install: install sbin/* -- Serge Hallyn Tue, 07 Jan 2014 11:43:03 -0600 cgmanager (0.02-1) trusty; urgency=medium * Switch to autoconf -- Serge Hallyn Mon, 06 Jan 2014 16:32:03 -0600 cgmanager (0.01-5) trusty; urgency=medium * import upstream patch to have make install create $(DESTDIR)/usr/bin -- Serge Hallyn Fri, 03 Jan 2014 17:11:50 -0600 cgmanager (0.01-4) trusty; urgency=medium * apply 0001-add-a-cgmanager-client.so.patch (from upstream). Next we should add a library package. -- Serge Hallyn Fri, 03 Jan 2014 16:46:43 -0600 cgmanager (0.01-3) trusty; urgency=medium * d/control: add a few more build-deps. -- Serge Hallyn Fri, 03 Jan 2014 16:21:52 -0600 cgmanager (0.01-2) trusty; urgency=medium * d/control: add nih-dbus-tool and libdbus-1-dev to build-deps -- Serge Hallyn Fri, 03 Jan 2014 15:14:42 -0600 cgmanager (0.01-1) trusty; urgency=low * Initial release -- Serge Hallyn Fri, 03 Jan 2014 14:12:07 -0600 debian/cgmanager.dirs0000664000000000000000000000000512317626565012007 0ustar sbin debian/control0000664000000000000000000000457412321415151010600 0ustar Source: cgmanager Section: admin Priority: optional Maintainer: Serge Hallyn Build-Depends: autotools-dev, debhelper (>= 9), dh-autoreconf, hardening-wrapper, help2man, libdbus-1-dev, libnih-dbus-dev, libnih-dev, libtool, nih-dbus-tool, pkg-config, Standards-Version: 3.9.5 Homepage: http://cgmanager.linuxcontainers.org/ XS-Testsuite: autopkgtest Package: cgmanager Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends} Suggests: cgmanager-utils Description: Central cgroup manager daemon cgmanager provides a central cgroup manager daemon and a per-namespace manager proxy, allowing users and programs to administrate cgroups through D-Bus requests. . This package contains the cgroup management daemon and proxy. Package: cgmanager-utils Architecture: any Depends: cgmanager, dbus, ${misc:Depends} Description: Central cgroup manager daemon (utilities) cgmanager provides a central cgroup manager daemon and a per-namespace manager proxy, allowing users and programs to administrate cgroups through D-Bus requests. . This package contains cgmanager-related utilities. Package: cgmanager-tests Architecture: any Depends: cgmanager, ${misc:Depends} Description: Central cgroup manager daemon (tests) cgmanager provides a central cgroup manager daemon and a per-namespace manager proxy, allowing users and programs to administrate cgroups through D-Bus requests. . This package contains the test scripts. Package: libcgmanager0 Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends} Multi-Arch: same Description: Central cgroup manager daemon (client library) cgmanager provides a central cgroup manager daemon and a per-namespace manager proxy, allowing users and programs to administrate cgroups through D-Bus requests. . This package contains the shared library. Package: libcgmanager-dev Section: libdevel Architecture: any Multi-Arch: same Depends: ${misc:Depends}, libcgmanager0 (= ${binary:Version}), libdbus-1-dev, libnih-dbus-dev Description: Central cgroup manager daemon (dev) cgmanager provides a central cgroup manager daemon and a per-namespace manager proxy, allowing users and programs to administrate cgroups through D-Bus requests. . This package contains the static library and C header files needed for developing software using libcgmanager. debian/cgmanager-utils.install0000664000000000000000000000001712317626565013655 0ustar bin/* usr/bin/ debian/libcgmanager-dev.install0000664000000000000000000000012412317626565013761 0ustar usr/lib/*/pkgconfig/libcgmanager.pc usr/include/cgmanager usr/lib/*/libcgmanager.so debian/compat0000664000000000000000000000000212317626565010403 0ustar 9 debian/cgmanager-utils.manpages0000664000000000000000000000000612317626565014000 0ustar cgm.1 debian/cgmanager.manpages0000664000000000000000000000002612317626565012644 0ustar cgmanager.8 cgproxy.8 debian/cgmanager-tests.install0000664000000000000000000000003212317626565013654 0ustar usr/share/cgmanager/tests debian/rules0000775000000000000000000000162312317626565010267 0ustar #!/usr/bin/make -f # -*- makefile -*- export DEB_BUILD_HARDENING = 1 DEB_DH_INSTALLINIT_ARGS = --upstart-only DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH) # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 %: dh $@ --with autotools_dev --with autoreconf override_dh_autoreconf: [ -e m4 ] || mkdir m4 dh_autoreconf override_dh_auto_configure: dh_auto_configure -- --exec-prefix= override_dh_install: mkdir -p $(CURDIR)/debian/tmp/lib/$(DEB_HOST_MULTIARCH) mv $(CURDIR)/debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/libcgmanager.so.* \ $(CURDIR)/debian/tmp/lib/$(DEB_HOST_MULTIARCH)/ for i in $(CURDIR)/debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/libcgmanager.so ; do \ dest=$$(readlink $$i) ; \ rm -f $$i ; \ ln -s /lib/$(DEB_HOST_MULTIARCH)/$$dest $$i ; \ done dh_install dh_installinit -pcgmanager --name=cgmanager dh_installinit -pcgmanager --name=cgproxy debian/cgmanager.lintian-overrides0000664000000000000000000000027412317626565014514 0ustar postrm-does-not-call-updaterc.d-for-init.d-script etc/init.d/cgmanager init.d-script-not-marked-as-conffile etc/init.d/cgmanager init.d-script-not-included-in-package etc/init.d/cgmanager debian/tests/0000775000000000000000000000000012317653305010337 5ustar debian/tests/control0000664000000000000000000000012212317626565011745 0ustar Tests: exercise Depends: cgmanager, dbus, @ Restrictions: needs-root allow-stderr debian/tests/exercise0000775000000000000000000000010012317626565012073 0ustar #!/bin/sh set -eu cd /usr/share/cgmanager/tests/ ./runtests.sh debian/patches/0000775000000000000000000000000012317653305010624 5ustar debian/patches/series0000664000000000000000000000005712317626647012054 0ustar makefile-shared 0001-Add-sigstop-support.patch debian/patches/makefile-shared0000664000000000000000000000205712317626565013604 0ustar Index: cgmanager-0.24/Makefile.am =================================================================== --- cgmanager-0.24.orig/Makefile.am 2014-04-02 14:31:41.000000000 -0500 +++ cgmanager-0.24/Makefile.am 2014-04-02 14:39:25.059601582 -0500 @@ -9,7 +9,7 @@ LIBCGMANAGER_VERSION_DOTTED = $(VERSION_ AM_CFLAGS = -Wall -ggdb -D_GNU_SOURCE -DSBINDIR=\"$(SBINDIR)\" AM_CFLAGS += $(DBUS_CFLAGS) $(NIH_CFLAGS) $(NIH_DBUS_CFLAGS) -AM_LDFLAGS = $(DBUS_LIBS) $(NIH_LIBS) $(NIH_DBUS_LIBS) +AM_LDFLAGS = $(DBUS_LIBS) $(NIH_LIBS) $(NIH_DBUS_LIBS) -shared client_files_OUTPUTS = cgmanager-client.c cgmanager-client.h manager_files_OUTPUTS = org.linuxcontainers.cgmanager.c org.linuxcontainers.cgmanager.h @@ -81,7 +81,7 @@ libcgmanager_la_SOURCES = \ org.linuxcontainers.cgmanager.xml libcgmanager_la_CFLAGS = -fPIC -DPIC $(DBUS_CFLAGS) $(NIH_CFLAGS) $(NIH_DBUS_CFLAGS) libcgmanager_la_LDFLAGS = -E \ - -version-info $(LIBCGMANAGER_VERSION) + -version-info $(LIBCGMANAGER_VERSION) $(AM_LDFLAGS) libcgmanager_la_LIBADD = \ $(DBUS_LIBS) $(NIH_CFLAGS) $(NIH_DBUS_CFLAGS) debian/patches/0001-Add-sigstop-support.patch0000664000000000000000000000505712317626613016124 0ustar From 061440458d8fcf3983ece16cf4d5f1a0d9d5fee6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Graber?= Date: Fri, 4 Apr 2014 13:11:37 -0400 Subject: [PATCH] Add --sigstop support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is used to indicate that the service is ready so that upstart and possibly some other systems can then have depending services start. --daemon does something similar, however calling it prevents log message from being logged. Signed-off-by: Stéphane Graber Signed-off-by: Serge Hallyn --- cgmanager-proxy.c | 5 +++++ cgmanager.c | 5 +++++ frontend.c | 1 + frontend.h | 1 + 4 files changed, 12 insertions(+) diff --git a/cgmanager-proxy.c b/cgmanager-proxy.c index 075c13f..35d797d 100644 --- a/cgmanager-proxy.c +++ b/cgmanager-proxy.c @@ -948,6 +948,8 @@ out: static NihOption options[] = { { 0, "daemon", N_("Detach and run in the background"), NULL, NULL, &daemonise, NULL }, + { 0, "sigstop", N_("Raise SIGSTOP when ready"), + NULL, NULL, &sigstop, NULL }, { 0, "check-master", N_("Check whether cgmanager is running"), NULL, NULL, &checkmaster, NULL }, @@ -1030,6 +1032,9 @@ main (int argc, char *argv[]) exit(1); } + if (sigstop) + raise(SIGSTOP); + ret = nih_main_loop (); /* Destroy any PID file we may have created */ diff --git a/cgmanager.c b/cgmanager.c index b3567ff..bb1ba5c 100644 --- a/cgmanager.c +++ b/cgmanager.c @@ -739,6 +739,8 @@ static NihOption options[] = { NULL, "subsystems to mount", NULL, my_setter }, { 0, "daemon", N_("Detach and run in the background"), NULL, NULL, &daemonise, NULL }, + { 0, "sigstop", N_("Raise SIGSTOP when ready"), + NULL, NULL, &sigstop, NULL }, NIH_OPTION_LAST }; @@ -884,6 +886,9 @@ main (int argc, char *argv[]) } } + if (sigstop) + raise(SIGSTOP); + ret = nih_main_loop (); /* Destroy any PID file we may have created */ diff --git a/frontend.c b/frontend.c index c575d5f..036594c 100644 --- a/frontend.c +++ b/frontend.c @@ -24,6 +24,7 @@ #include int daemonise = FALSE; +int sigstop = FALSE; bool setns_pid_supported = false; unsigned long mypidns; bool setns_user_supported = false; diff --git a/frontend.h b/frontend.h index c8ce4ae..144fd07 100644 --- a/frontend.h +++ b/frontend.h @@ -69,6 +69,7 @@ **/ #ifndef __frontend_c extern int daemonise; +extern int sigstop; extern bool setns_pid_supported; extern unsigned long mypidns; extern bool setns_user_supported; -- 1.9.1 debian/cgmanager.install0000664000000000000000000000000512317626565012514 0ustar sbin debian/cgmanager.cgmanager.upstart0000664000000000000000000000222112322666654014474 0ustar description "cgroup management daemon" author "Serge Hallyn " respawn expect stop # in trusty /sys/fs/cgroup will be mounted for us. # prior to saucy, we would need to start on mounted # MOUNTPOINT=/sys, and mount /sys/fs/cgroup ourselves start on mounted MOUNTPOINT=/sys/fs/cgroup or virtual-filesystems stop on runlevel [06] # to get debug output into /var/log/upstart/cgmanager.log, create/edit # /etc/default/cgmanager and set cgmanager_opts="--debug" env cgmanager_opts="" # unbound subsystems cgmanager should mount. If you need to add more, # make the list comma-separated, for instance: # env cgm_extra_mounts="-m name=systemd,name=yyy" env cgm_extra_mounts="-m name=systemd" pre-start script # Kill any existing cgproxy. This is required to allow proper # respawning of cgmanager. stop cgproxy >/dev/null 2>&1 || true # check whether we should start a cgproxy or a cgmanager if cgproxy --check-master; then start cgproxy NESTED=yes || true && { stop; exit 0; } fi end script script [ -r /etc/default/cgmanager ] && . /etc/default/cgmanager exec /sbin/cgmanager --sigstop $cgmanager_opts $cgm_extra_mounts end script