Commit 54991ca5 authored by Mark Hindley's avatar Mark Hindley

Debian cgmanager_0.41.orig.tar.gz.

parent e6dffc42
......@@ -9,6 +9,7 @@ LIBCGMANAGER_VERSION_DOTTED = $(VERSION_CURRENT).$(VERSION_REVISION).$(VERSION_A
AM_CFLAGS = -Wall -ggdb -D_GNU_SOURCE -DSBINDIR=\"$(SBINDIR)\"
AM_CFLAGS += $(DBUS_CFLAGS) $(NIH_CFLAGS) $(NIH_DBUS_CFLAGS)
AM_CFLAGS += -DLIBEXECDIR=\"$(LIBEXECDIR)\"
AM_LDFLAGS = $(DBUS_LIBS) $(NIH_LIBS) $(NIH_DBUS_LIBS)
client_files_OUTPUTS = cgmanager-client.c cgmanager-client.h
manager_files_OUTPUTS = org.linuxcontainers.cgmanager.c org.linuxcontainers.cgmanager.h
......@@ -23,11 +24,15 @@ CLEANFILES = \
*.o *.so \
libcgmanager.pc.in
sbin_PROGRAMS = cgmanager cgproxy cgm-release-agent
sbin_PROGRAMS = cgmanager cgproxy
bin_PROGRAMS = cgm
pkglibexec_PROGRAMS = cgm-release-agent
lib_LTLIBRARIES = libcgmanager.la
SUBDIRS = config
pkginclude_HEADERS = cgmanager-client.h cgmanager.h
if HAVE_HELP2MAN
......@@ -103,10 +108,10 @@ cgm.1: cgm cgm.man.add
endif
install-exec-local:
$(MKDIR_P) $(DESTDIR)/usr/share/cgmanager/tests
$(MKDIR_P) $(DESTDIR)$(datarootdir)/cgmanager/tests
cd tests; \
for f in *.sh; do \
install -c -m 755 $$f $(DESTDIR)/usr/share/cgmanager/tests; \
install -c -m 755 $$f $(DESTDIR)$(datarootdir)/cgmanager/tests; \
done
rpm: dist
......@@ -131,6 +136,19 @@ TESTS_CGM_CONCURRENT: tests/cgm-concurrent.o
$(CCLD) -o tests/cgm-concurrent tests/cgm-concurrent.o \
$(NIH_LIBS) $(NIH_DBUS_LIBS) $(DBUS_LIBS) -lpthread -lcgmanager
tests: TESTS_CGM_CONCURRENT TESTS_SCM TEST_NSTEST
if HAVE_PAM
pam_LTLIBRARIES = pam_cgm.la
pam_cgm_la_SOURCES = pam/pam_cgm.c pam/cgmanager.c pam/cgmanager.h
pam_cgm_la_CFLAGS = $(AM_CFLAGS)
pam_cgm_la_LIBADD = $(AM_LIBS) $(PAM_LIBS) -L$(top_srcdir) -lcgmanager
pam_cgm_la_LDFLAGS = $(AM_LDFLAGS) -module -avoid-version -shared
pam_cgm_la_DEPENDENCIES = libcgmanager.la
install-data-hook: install-pamLTLIBRARIES
rm -f "$(DESTDIR)$(pamdir)/pam_cgm.la"
rm -f "$(DESTDIR)$(pamdir)/pam_cgm.a"
uninstall-local:
rm -f "$(DESTDIR)$(pamdir)/pam_cgm.so"
endif
SUBDIRS = config
tests: TESTS_CGM_CONCURRENT TESTS_SCM TEST_NSTEST
This diff is collapsed.
This diff is collapsed.
#! /bin/bash
# cgm - temporary wrapper script for .libs/cgm
# Generated by libtool (GNU libtool) 2.4.2 Debian-2.4.2-1.10ubuntu1
# Generated by libtool (GNU libtool) 2.4.6 Debian-2.4.6-0.1
#
# The cgm program cannot be directly executed until all the libtool
# libraries that it depends on are installed.
......@@ -11,7 +11,7 @@
# Sed substitution that helps us do robust quoting. It backslashifies
# metacharacters that are still active within double-quoted strings.
sed_quote_subst='s/\([`"$\\]\)/\\\1/g'
sed_quote_subst='s|\([`"$\\]\)|\\\1|g'
# Be Bourne compatible
if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
......@@ -31,12 +31,12 @@ DUALCASE=1; export DUALCASE # for MKS sh
# if CDPATH is set.
(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
relink_command="(cd /home/serge/src/cgmanager; { test -z \"\${LIBRARY_PATH+set}\" || unset LIBRARY_PATH || { LIBRARY_PATH=; export LIBRARY_PATH; }; }; { test -z \"\${COMPILER_PATH+set}\" || unset COMPILER_PATH || { COMPILER_PATH=; export COMPILER_PATH; }; }; { test -z \"\${GCC_EXEC_PREFIX+set}\" || unset GCC_EXEC_PREFIX || { GCC_EXEC_PREFIX=; export GCC_EXEC_PREFIX; }; }; { test -z \"\${LD_RUN_PATH+set}\" || unset LD_RUN_PATH || { LD_RUN_PATH=; export LD_RUN_PATH; }; }; { test -z \"\${LD_LIBRARY_PATH+set}\" || unset LD_LIBRARY_PATH || { LD_LIBRARY_PATH=; export LD_LIBRARY_PATH; }; }; PATH=/home/serge/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/home/serge/bin; export PATH; gcc -std=gnu99 -Wall -ggdb -D_GNU_SOURCE -DSBINDIR=\\\"//sbin\\\" -I/usr/include/dbus-1.0 -I/usr/lib/x86_64-linux-gnu/dbus-1.0/include -I/usr/include/dbus-1.0 -I/usr/lib/x86_64-linux-gnu/dbus-1.0/include -g -O2 -o \$progdir/\$file cgm.o -lnih -lnih-dbus -ldbus-1 -L.libs /home/serge/src/cgmanager/.libs/libcgmanager.so -Wl,-rpath -Wl,/home/serge/src/cgmanager/.libs -Wl,-rpath -Wl,//lib)"
relink_command="(cd /home/serge/src/cgmanager; { test -z \"\${LIBRARY_PATH+set}\" || unset LIBRARY_PATH || { LIBRARY_PATH=; export LIBRARY_PATH; }; }; { test -z \"\${COMPILER_PATH+set}\" || unset COMPILER_PATH || { COMPILER_PATH=; export COMPILER_PATH; }; }; { test -z \"\${GCC_EXEC_PREFIX+set}\" || unset GCC_EXEC_PREFIX || { GCC_EXEC_PREFIX=; export GCC_EXEC_PREFIX; }; }; { test -z \"\${LD_RUN_PATH+set}\" || unset LD_RUN_PATH || { LD_RUN_PATH=; export LD_RUN_PATH; }; }; { test -z \"\${LD_LIBRARY_PATH+set}\" || unset LD_LIBRARY_PATH || { LD_LIBRARY_PATH=; export LD_LIBRARY_PATH; }; }; PATH=/home/serge/go/bin:/home/serge/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snaps/bin:/home/serge/bin; export PATH; gcc -Wall -ggdb -D_GNU_SOURCE -DSBINDIR=\\\"/sbin\\\" -I/usr/include/dbus-1.0 -I/usr/lib/x86_64-linux-gnu/dbus-1.0/include -I/usr/include/dbus-1.0 -I/usr/lib/x86_64-linux-gnu/dbus-1.0/include -DLIBEXECDIR=\\\"/lib\\\" -g -O2 -o \$progdir/\$file cgm.o -lnih -lnih-dbus -ldbus-1 -L.libs /home/serge/src/cgmanager/.libs/libcgmanager.so -Wl,-rpath -Wl,/home/serge/src/cgmanager/.libs)"
# This environment variable determines our operation mode.
if test "$libtool_install_magic" = "%%%MAGIC variable%%%"; then
# install mode needs the following variables:
generated_by_libtool_version='2.4.2'
generated_by_libtool_version='2.4.6'
notinst_deplibs=' /home/serge/src/cgmanager/libcgmanager.la'
else
# When we are sourced in execute mode, $file and $ECHO are already set.
......@@ -55,9 +55,9 @@ _LTECHO_EOF'
# Very basic option parsing. These options are (a) specific to
# the libtool wrapper, (b) are identical between the wrapper
# /script/ and the wrapper /executable/ which is used only on
# /script/ and the wrapper /executable/ that is used only on
# windows platforms, and (c) all begin with the string --lt-
# (application programs are unlikely to have options which match
# (application programs are unlikely to have options that match
# this pattern).
#
# There are only two supported options: --lt-debug and
......@@ -90,7 +90,7 @@ func_parse_lt_options ()
# Print the debug banner immediately:
if test -n "$lt_option_debug"; then
echo "cgm:cgm:${LINENO}: libtool wrapper (GNU libtool) 2.4.2 Debian-2.4.2-1.10ubuntu1" 1>&2
echo "cgm:cgm:$LINENO: libtool wrapper (GNU libtool) 2.4.6 Debian-2.4.6-0.1" 1>&2
fi
}
......@@ -101,7 +101,7 @@ func_lt_dump_args ()
lt_dump_args_N=1;
for lt_arg
do
$ECHO "cgm:cgm:${LINENO}: newargv[$lt_dump_args_N]: $lt_arg"
$ECHO "cgm:cgm:$LINENO: newargv[$lt_dump_args_N]: $lt_arg"
lt_dump_args_N=`expr $lt_dump_args_N + 1`
done
}
......@@ -111,7 +111,7 @@ func_exec_program_core ()
{
if test -n "$lt_option_debug"; then
$ECHO "cgm:cgm:${LINENO}: newargv[0]: $progdir/$program" 1>&2
$ECHO "cgm:cgm:$LINENO: newargv[0]: $progdir/$program" 1>&2
func_lt_dump_args ${1+"$@"} 1>&2
fi
exec "$progdir/$program" ${1+"$@"}
......@@ -201,7 +201,7 @@ func_exec_program ()
if test -n "$relink_command"; then
if relink_command_output=`eval $relink_command 2>&1`; then :
else
printf %s\n "$relink_command_output" >&2
$ECHO "$relink_command_output" >&2
rm -f "$progdir/$file"
exit 1
fi
......@@ -220,7 +220,7 @@ func_exec_program ()
fi
else
# The program doesn't exist.
$ECHO "$0: error: \`$progdir/$program' does not exist" 1>&2
$ECHO "$0: error: '$progdir/$program' does not exist" 1>&2
$ECHO "This script is just a wrapper for $program." 1>&2
$ECHO "See the libtool documentation for more information." 1>&2
exit 1
......
......@@ -21,5 +21,17 @@ Then to freeze that cgroup,
.br
cgm setvalue freezer foo freezer.state FROZEN
[NOTES]
In order to protect the host from root in containers, cgmanager locks
prevents tasks from administering cgroups which are not under their
own. The exceptions are that root in a container may escape up to
the cgroup of its cgproxy, and root on the host may escape to the
root cgroup.
This means that a user in freezer cgroup /foo cannot list cgroups in
/. However, as root he can use movepidabs to escape to /, then
list cgroups in /.
[SEE ALSO]
cgmanager(8)
......@@ -68,6 +68,11 @@ int setup_proxy(void)
bool exists_upper = false, exists_lower = false;
NihError *err;
/* When running in container, /sys/fs/cgroup will have been
already mounted. But it may be ro */
if (is_ro_mount(CGDIR))
turn_mount_rw(CGDIR);
/*
* If /sys/fs/cgroup/cgmanager.lower exists,
* if /sys/fs/cgroup/cgmanager exists, then exit (proxy already running)
......@@ -254,7 +259,7 @@ static bool complete_dbus_request(DBusMessage *message,
return true;
}
int get_pid_cgroup_main (void *parent, const char *controller,
int get_pid_cgroup_main (void *parent, char *controller,
struct ucred p, struct ucred r, struct ucred v, char **output)
{
DBusMessage *message;
......@@ -304,7 +309,7 @@ out:
return ret;
}
int get_pid_cgroup_abs_main (void *parent, const char *controller,
int get_pid_cgroup_abs_main (void *parent, char *controller,
struct ucred p, struct ucred r, struct ucred v, char **output)
{
DBusMessage *message;
......@@ -619,7 +624,7 @@ out:
return ret;
}
int get_value_main (void *parent, const char *controller, const char *cgroup,
int get_value_main (void *parent, char *controller, const char *cgroup,
const char *key, struct ucred p, struct ucred r, char **value)
{
DBusMessage *message;
......@@ -682,7 +687,7 @@ out:
return ret;
}
int set_value_main (const char *controller, const char *cgroup,
int set_value_main (char *controller, const char *cgroup,
const char *key, const char *value, struct ucred p,
struct ucred r)
{
......@@ -805,7 +810,7 @@ out:
return ret;
}
int get_tasks_main (void *parent, const char *controller, const char *cgroup,
int get_tasks_main (void *parent, char *controller, const char *cgroup,
struct ucred p, struct ucred r, int32_t **pids)
{
DBusMessage *message;
......@@ -956,7 +961,7 @@ out:
return ret;
}
int list_children_main (void *parent, const char *controller, const char *cgroup,
int list_children_main (void *parent, char *controller, const char *cgroup,
struct ucred p, struct ucred r, char ***output)
{
DBusMessage *message;
......@@ -1244,7 +1249,7 @@ static char *find_eol(char *s)
return s;
}
int list_keys_main (void *parent, const char *controller, const char *cgroup,
int list_keys_main (void *parent, char *controller, const char *cgroup,
struct ucred p, struct ucred r,
struct keys_return_type ***output)
{
......@@ -1382,6 +1387,8 @@ main (int argc, char *argv[])
nih_main_init (argv[0]);
nih_main_set_pidfile (CGPROXY_PIDFILE);
nih_option_set_synopsis (_("Control group proxy"));
nih_option_set_help (_("The cgroup manager proxy"));
......@@ -1454,10 +1461,5 @@ main (int argc, char *argv[])
ret = nih_main_loop ();
/* Destroy any PID file we may have created */
if (daemonise) {
nih_main_unlink_pidfile();
}
return ret;
}
This diff is collapsed.
......@@ -7,3 +7,5 @@
#define CGMANAGER_DBUS_PATH "unix:path=" CGMANAGER_SOCK
#define CGPROXY_DBUS_PATH "unix:path=" CGPROXY_SOCK
#define CGMANAGER_PIDFILE "/run/cgmanager.pid"
#define CGPROXY_PIDFILE "/run/cgproxy.pid"
......@@ -21,7 +21,7 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Name: cgmanager
Version: 0.36
Version: 0.41
Release: 1%{?dist}
URL: http://cgmanager.linuxcontainers.org
Source: http://cgmanager.linuxcontainers.org/downloads/%{name}-%{version}.tar.gz
......
......@@ -36,8 +36,7 @@
/* Define to 1 if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H
/* Define to the sub-directory in which libtool stores uninstalled libraries.
*/
/* Define to the sub-directory where libtool stores uninstalled libraries. */
#undef LT_OBJDIR
/* Name of package */
......
# Makefile.in generated by automake 1.14.1 from Makefile.am.
# Makefile.in generated by automake 1.15 from Makefile.am.
# @configure_input@
# Copyright (C) 1994-2013 Free Software Foundation, Inc.
# Copyright (C) 1994-2014 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
......@@ -14,7 +14,17 @@
@SET_MAKE@
VPATH = @srcdir@
am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
am__is_gnu_make = { \
if test -z '$(MAKELEVEL)'; then \
false; \
elif test -n '$(MAKE_HOST)'; then \
true; \
elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
true; \
else \
false; \
fi; \
}
am__make_running_with_option = \
case $${target_option-} in \
?) ;; \
......@@ -78,7 +88,6 @@ POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
subdir = config
DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
......@@ -86,6 +95,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
......@@ -145,6 +155,7 @@ am__define_uniq_tagged_files = \
ETAGS = etags
CTAGS = ctags
DIST_SUBDIRS = $(SUBDIRS)
am__DIST_COMMON = $(srcdir)/Makefile.in
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
am__relativize = \
dir0=`pwd`; \
......@@ -207,12 +218,14 @@ INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LD = @LD@
LDFLAGS = @LDFLAGS@
LIBEXECDIR = @LIBEXECDIR@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LIPO = @LIPO@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
MAKEINFO = @MAKEINFO@
MANIFEST_TOOL = @MANIFEST_TOOL@
MKDIR_P = @MKDIR_P@
......@@ -234,6 +247,8 @@ PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PAM_CFLAGS = @PAM_CFLAGS@
PAM_LIBS = @PAM_LIBS@
PATH_SEPARATOR = @PATH_SEPARATOR@
PKG_CONFIG = @PKG_CONFIG@
PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
......@@ -285,10 +300,12 @@ localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
pamdir = @pamdir@
pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
runstatedir = @runstatedir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
......@@ -313,7 +330,6 @@ $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu config/Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --gnu config/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
......@@ -608,6 +624,8 @@ uninstall-am:
mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \
ps ps-am tags tags-am uninstall uninstall-am
.PRECIOUS: Makefile
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
......
SUBDIRS = systemd sysvinit upstart
SUBDIRS = bsd systemd sysvinit upstart openrc
# Makefile.in generated by automake 1.14.1 from Makefile.am.
# Makefile.in generated by automake 1.15 from Makefile.am.
# @configure_input@
# Copyright (C) 1994-2013 Free Software Foundation, Inc.
# Copyright (C) 1994-2014 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
......@@ -14,7 +14,17 @@
@SET_MAKE@
VPATH = @srcdir@
am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
am__is_gnu_make = { \
if test -z '$(MAKELEVEL)'; then \
false; \
elif test -n '$(MAKE_HOST)'; then \
true; \
elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
true; \
else \
false; \
fi; \
}
am__make_running_with_option = \
case $${target_option-} in \
?) ;; \
......@@ -78,7 +88,6 @@ POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
subdir = config/init
DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
......@@ -86,6 +95,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
......@@ -145,6 +155,7 @@ am__define_uniq_tagged_files = \
ETAGS = etags
CTAGS = ctags
DIST_SUBDIRS = $(SUBDIRS)
am__DIST_COMMON = $(srcdir)/Makefile.in
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
am__relativize = \
dir0=`pwd`; \
......@@ -207,12 +218,14 @@ INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LD = @LD@
LDFLAGS = @LDFLAGS@
LIBEXECDIR = @LIBEXECDIR@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LIPO = @LIPO@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
MAKEINFO = @MAKEINFO@
MANIFEST_TOOL = @MANIFEST_TOOL@
MKDIR_P = @MKDIR_P@
......@@ -234,6 +247,8 @@ PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PAM_CFLAGS = @PAM_CFLAGS@
PAM_LIBS = @PAM_LIBS@
PATH_SEPARATOR = @PATH_SEPARATOR@
PKG_CONFIG = @PKG_CONFIG@
PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
......@@ -285,10 +300,12 @@ localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
pamdir = @pamdir@
pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
runstatedir = @runstatedir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
......@@ -297,7 +314,7 @@ target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
SUBDIRS = systemd sysvinit upstart
SUBDIRS = bsd systemd sysvinit upstart openrc
all: all-recursive
.SUFFIXES:
......@@ -313,7 +330,6 @@ $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu config/init/Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --gnu config/init/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
......@@ -608,6 +624,8 @@ uninstall-am:
mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \
ps ps-am tags tags-am uninstall uninstall-am
.PRECIOUS: Makefile
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
......
EXTRA_DIST = rc.cgmanager rc.cgproxy
if INIT_SCRIPT_BSD
install-bsd: rc.cgmanager rc.cgproxy
$(MKDIR_P) $(DESTDIR)$(sysconfdir)/rc.d
$(INSTALL_SCRIPT) rc.cgmanager $(DESTDIR)$(sysconfdir)/rc.d/rc.cgmanager
$(INSTALL_SCRIPT) rc.cgproxy $(DESTDIR)$(sysconfdir)/rc.d/rc.cgproxy
uninstall-bsd:
rm -f $(DESTDIR)$(sysconfdir)/rc.d/rc.cgmanager
rm -f $(DESTDIR)$(sysconfdir)/rc.d/rc.cgproxy
rmdir $(DESTDIR)$(sysconfdir)/rc.d || :
install-data-local: install-bsd
uninstall-local: uninstall-bsd
endif
This diff is collapsed.
#!/bin/sh
#
# /etc/rc.d/rc.cgmanager - start/stop the cgroup manager
PATH=/sbin:/usr/sbin:/bin:/usr/bin
CGMDAEMON=/usr/sbin/cgmanager
CGPDAEMON=/usr/sbin/cgproxy
NAME=cgmanager
DESC="cgroup management daemon"
test -x $CGMDAEMON || exit 0
if [ -f /etc/default/$NAME ]; then
# get cgmanager options if specified
. /etc/default/$NAME
fi
start_cgmanager() {
# Kill any existing cgproxy
/etc/rc.d/rc.cgproxy stop >/dev/null 2>&1 || true
# check whether to start cgproxy or cgmanager
if $CGPDAEMON --check-master; then
NESTED=yes /etc/rc.d/rc.cgproxy start || true && { exit 0; }
fi
$CGMDAEMON --daemon
}
stop_cgmanager() {
# If the cgmanager stops, the proxy must also stop
/etc/rc.d/rc.cgproxy stop >/dev/null 2>&1 || true
/usr/bin/pkill $NAME
}
restart_cgmanager() {
stop_cgmanager
start_cgmanager
}
case "$1" in
'start')
start_cgmanager
;;
'stop')
stop_cgmanager
;;
'restart')
restart_cgmanager
;;
*)
echo "usage $0 start|stop|restart"
esac
#!/bin/sh
#
# /etc/rc.d/rc.cgproxy - start/stop the cgroup proxy manager
PATH=/sbin:/usr/sbin:/bin:/usr/bin
CGMDAEMON=/usr/sbin/cgmanager
CGPDAEMON=/usr/sbin/cgproxy
NAME=cgproxy
DESC="cgroup proxy management daemon"
test -x $CGPDAEMON || exit 0
if [ -f /etc/default/$NAME ]; then
# get cgproxy options if specified
. /etc/default/$NAME
fi
start_cgproxy() {
# cgproxy should only run on container unless on older kernel
if [ -e /proc/self/ns/pid ] && [ "$NESTED" != "yes" ]; then
exit 0
fi
$CGPDAEMON --daemon
sleep 1
}
stop_cgproxy() {
/usr/bin/pkill $NAME && return
# Try again if we're still here
echo "Waiting to finish $NAME ..."
sleep 1
/usr/bin/pkill -TERM $NAME && return
echo "Still waiting to finish $NAME ..."
sleep 5
/usr/bin/pkill -KILL $NAME && return
echo "Couldn't finish $NAME !!!"
}
restart_cgproxy() {
stop_cgproxy
start_cgproxy
}
case "$1" in
'start')
start_cgproxy
;;
'stop')
stop_cgproxy
;;
'restart')
restart_cgproxy
;;
*)
echo "usage $0 start|stop|restart"
esac
EXTRA_DIST = cgmanager cgproxy
if INIT_SCRIPT_OPENRC
RC_INIT_DIR = $(sysconfdir)/init.d
install-openrc: cgmanager cgproxy
$(MKDIR_P) $(DESTDIR)$(RC_INIT_DIR)
$(INSTALL_DATA) cgmanager $(DESTDIR)$(RC_INIT_DIR)/
$(INSTALL_DATA) cgproxy $(DESTDIR)$(RC_INIT_DIR)/
uninstall-openrc:
rm -f $(DESTDIR)$(RC_INIT_DIR)/cgmanager
rm -f $(DESTDIR)$(RC_INIT_DIR)/cgroxy
rmdir $(DESTDIR)$(RC_INIT_DIR) || :
install-data-local: install-openrc
uninstall-local: uninstall-openrc
endif
This diff is collapsed.
#!/sbin/openrc-run
# Copyright 1999-2015 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$
description="Control Group manager daemon"
pidfile="/run/cgmanager.pid"
command="/usr/sbin/cgmanager"
command_args="-m name=systemd"
command_background="yes"
retry="TERM/45"
depend() {
before cgproxy
}
#!/sbin/openrc-run
# Copyright 1999-2015 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$
description="Control Group manager proxy"
pidfile="/run/cgproxy.pid"
command="/usr/sbin/cgproxy"
command_args="--daemon"
command_background="yes"
retry="TERM/45"
NESTED="${NESTED:-no}"
depend() {
after cgmanager
}
start_pre() {
if ! /usr/sbin/cgproxy --check-master; then
ewarn "cgmanager is not running"
return 1
fi
# cgproxy should only run on container unless on older kernel
if [ -e /proc/self/ns/pid ] && [ "$NESTED" != "yes" ]; then
eerror "Too old kernel to support cgroup, please update to >3.8"
return 1
fi
}
# Makefile.in generated by automake 1.14.1 from Makefile.am.
# Makefile.in generated by automake 1.15 from Makefile.am.
# @configure_input@
# Copyright (C) 1994-2013 Free Software Foundation, Inc.
# Copyright (C) 1994-2014 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
......@@ -14,7 +14,17 @@
@SET_MAKE@
VPATH = @srcdir@
am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
am__is_gnu_make = { \
if test -z '$(MAKELEVEL)'; then \
false; \
elif test -n '$(MAKE_HOST)'; then \
true; \
elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
true; \
else \
false; \
fi; \
}
am__make_running_with_option = \
case $${target_option-} in \
?) ;; \
......@@ -78,7 +88,6 @@ POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
subdir = config/init/systemd
DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
......@@ -86,6 +95,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
<