aboutsummaryrefslogtreecommitdiffstats
path: root/testing/cgmanager/cgproxy.initd
diff options
context:
space:
mode:
authorCarlo Landmeter <clandmeter@gmail.com>2015-09-24 22:57:47 +0200
committerCarlo Landmeter <clandmeter@gmail.com>2015-09-24 22:58:17 +0200
commit620028dbe7d749f1fe2ce24587a742a95c6ce6e2 (patch)
tree9ce30baf6995168c546759a00154adb946bc7475 /testing/cgmanager/cgproxy.initd
parent4db404aa8d35aa25692f06fab9cdb6cdfc33a0c9 (diff)
downloadaports-620028dbe7d749f1fe2ce24587a742a95c6ce6e2.tar.gz
aports-620028dbe7d749f1fe2ce24587a742a95c6ce6e2.tar.bz2
aports-620028dbe7d749f1fe2ce24587a742a95c6ce6e2.tar.xz
testing/cgmanager: new aport
Diffstat (limited to 'testing/cgmanager/cgproxy.initd')
-rw-r--r--testing/cgmanager/cgproxy.initd37
1 files changed, 37 insertions, 0 deletions
diff --git a/testing/cgmanager/cgproxy.initd b/testing/cgmanager/cgproxy.initd
new file mode 100644
index 0000000000..980606719c
--- /dev/null
+++ b/testing/cgmanager/cgproxy.initd
@@ -0,0 +1,37 @@
+#!/sbin/runscript
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/app-admin/cgmanager/files/cgproxy.initd,v 1.2 2015/02/16 11:02:06 hwoarang Exp $
+
+DAEMON=/usr/sbin/cgproxy
+PIDFILE=/run/cgproxy.pid
+NESTED=yes
+OPTIONS=
+
+depend() {
+ before cgmanager
+}
+
+start() {
+ ebegin "Starting cgproxy server"
+ 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
+
+ start-stop-daemon --start --pidfile ${PIDFILE} --exec ${DAEMON} \
+ -- --daemon ${OPTIONS}
+
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping cgproxy server"
+ start-stop-daemon --stop --quiet -R TERM/45 -p ${PIDFILE}
+ eend $?
+}