aboutsummaryrefslogtreecommitdiffstats
path: root/unmaintained/libcgroup
diff options
context:
space:
mode:
authorCarlo Landmeter <clandmeter@gmail.com>2016-08-25 15:26:24 +0200
committerCarlo Landmeter <clandmeter@gmail.com>2016-08-25 15:26:24 +0200
commitb6af1e02efe594039707cd882517663d5370f375 (patch)
treeff9c2d55873e051e82972ba64c017352d3a75d34 /unmaintained/libcgroup
parenta71346b7acebc600960a98c84fb32cfd72fe864b (diff)
downloadaports-b6af1e02efe594039707cd882517663d5370f375.tar.bz2
aports-b6af1e02efe594039707cd882517663d5370f375.tar.xz
testing/[multiple]: move unmaintained packages
This moves all packages from testing to unmaintained which have not been updated for atleast 6 months. If you are affected by this commit please follow this proceddure: * make sure your packages build on all architectures * move your pacakge(s) back to testing * if you want to keep this package and can maintain it (or find somebody to maintain it for you) for a minimum of 6 months ask it to be moved to community
Diffstat (limited to 'unmaintained/libcgroup')
-rw-r--r--unmaintained/libcgroup/APKBUILD102
-rw-r--r--unmaintained/libcgroup/cgconfig.confd4
-rw-r--r--unmaintained/libcgroup/cgconfig.initd120
-rw-r--r--unmaintained/libcgroup/cgred.confd17
-rw-r--r--unmaintained/libcgroup/cgred.initd34
-rw-r--r--unmaintained/libcgroup/musl-decls-compat.patch207
6 files changed, 484 insertions, 0 deletions
diff --git a/unmaintained/libcgroup/APKBUILD b/unmaintained/libcgroup/APKBUILD
new file mode 100644
index 000000000..eebbaf933
--- /dev/null
+++ b/unmaintained/libcgroup/APKBUILD
@@ -0,0 +1,102 @@
+# Contributor: Natanael Copa <ncopa@alpinelinux.org>
+# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
+pkgname=libcgroup
+pkgver=0.38
+pkgrel=3
+pkgdesc="Library to control and monitor control groups"
+url="http://libcg.sourceforge.net/"
+arch="all"
+license="LGPLv2+"
+depends=""
+depends_dev=""
+makedepends="$depends_dev bison flex linux-headers linux-pam-dev fts-dev"
+install=""
+options="suid"
+subpackages="$pkgname-dev $pkgname-doc $pkgname-tools $pkgname-pam"
+source="http://downloads.sourceforge.net/libcg/libcgroup-$pkgver.tar.bz2
+ cgconfig.initd
+ cgconfig.confd
+ cgred.initd
+ cgred.confd
+ musl-decls-compat.patch
+ "
+
+_builddir="$srcdir"/libcgroup-$pkgver
+prepare() {
+ local i
+ cd "$_builddir"
+ for i in $source; do
+ case $i in
+ *.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;;
+ esac
+ done
+ sed -e 's:/etc/cgrules.conf:/etc/cgroup/cgrules.conf:' \
+ -i src/libcgroup-internal.h || return 1
+}
+
+build() {
+ cd "$_builddir"
+ ./configure --prefix=/usr \
+ --enable-shared \
+ --enable-daemon \
+ --enable-tools \
+ || return 1
+ make LIBS=-lfts || return 1
+}
+
+package() {
+ local _sysconfdir="$pkgdir"/etc
+ cd "$_builddir"
+ make DESTDIR="$pkgdir" install || return 1
+
+ # config files
+ install -d "$_sysconfdir"
+ install -m 644 samples/cgconfig.conf "$_sysconfdir"/cgconfig.conf \
+ || return 1
+ install -m 644 samples/cgrules.conf "$_sysconfdir"/cgrules.conf \
+ || return 1
+ install -m 644 samples/cgsnapshot_blacklist.conf \
+ "$_sysconfdir"/cgsnapshot_blacklist.conf || return 1
+
+ # init scripts
+ for i in $source; do
+ case $i in
+ *.initd) install -Dm755 "$srcdir"/$i \
+ "$pkgdir"/etc/init.d/${i%.*} || return 1;;
+ *.confd) install -Dm644 "$srcdir"/$i \
+ "$pkgdir"/etc/conf.d/${i%.*} || return 1;;
+ esac
+ done
+}
+
+tools() {
+ pkgdesc="Command-line utility programs, services and daemons for libcgroup"
+ install -d "$subpkgdir"/usr
+ mv "$pkgdir"/usr/bin "$pkgdir"/usr/sbin "$subpkgdir"/usr/
+ mv "$pkgdir"/etc "$subpkgdir"/
+}
+
+pam() {
+ pkgdesc="A Pluggable Authentication Module for libcgroup"
+ install -d "$subpkgdir"/usr/lib
+ mv "$pkgdir"/usr/lib/security "$subpkgdir"/usr/lib/
+}
+
+md5sums="f0f7d4060bf36ccc19d75dbf4f1695db libcgroup-0.38.tar.bz2
+79b7a9f739af3a8ac05e4e02faadc036 cgconfig.initd
+7743c134ead2422fbd375447c4c9654c cgconfig.confd
+7574db63b6f74a3c816cd05d6032a138 cgred.initd
+f36926f1a968d3ee5fd7f0d7a6a7167e cgred.confd
+f9994beb5511e1381c2878fd9b7d1163 musl-decls-compat.patch"
+sha256sums="5d36d1a48b95f62fe9fcdf74a5a4089512e5e43e6011aa1504fd6f2a0909867f libcgroup-0.38.tar.bz2
+53d8e06a64efa338a66ab1c94d185450f99d46f4517e7a0e5fe8fce75fa6dca0 cgconfig.initd
+ac52788366561ca6b79bca0e9fc9630568401b4301e386e6851fd8eb75a539ab cgconfig.confd
+05f0c39c72cbf53d5a77d8ff056350832140e599f90f0911d87ec06314ffcd19 cgred.initd
+72c00285c1f89f3a0564418c33bd02dfbcee2ae90f540a885ef57d1ef940a04c cgred.confd
+02d6fb7911c433e1e373e8b548bbcc5c317f058e1aa5db226ce92a29a42696c0 musl-decls-compat.patch"
+sha512sums="763e52bee699b0461508eabb6fdf3a79f15d1d8cdbc6631fcae93127eb7648e6bab660cf3a31019b966095113f9a086d55b5351c7999f3654f8e6c95507725d5 libcgroup-0.38.tar.bz2
+e224271db461f7953d8880d7f33b571c69d1237aedb127bcddad356dd3f046504c5917a5a2b00d64051bec72661322b43966ede83587fc54c75a32c16f2c3aaa cgconfig.initd
+9bb289c20c3230414888e82be2b7a1389ac652143bcbbc746d0731c46a2f1404b4bc8154c90b59ebc53520107fe2f04c9eb5df742451887947b8a3b7a4c31f00 cgconfig.confd
+8be89446fac65ba7f18269bd88d31f60e49da6488d85dfad9aa33304a5b14e700d86258894876d01a05c1bf4db5f5e1d40a361693022e768e11af2bf6cfde61b cgred.initd
+871b7e7df26bf6b4164d5ec04e9998b0bd3f354e75ba2306b330e382eadd38ad044f85cfaa122a5a2e600fb4f39e1a7fe7778551a05dfc3e0ae095621c965996 cgred.confd
+8b4444b0583817bb6844d01a8d0d956a884a58ab8fb3ddd402a4ba9c5f505a7f8495abf06776685d9b10246b96ced64d74cab73484a84f3ecb53e8273ab76456 musl-decls-compat.patch"
diff --git a/unmaintained/libcgroup/cgconfig.confd b/unmaintained/libcgroup/cgconfig.confd
new file mode 100644
index 000000000..e41730ae0
--- /dev/null
+++ b/unmaintained/libcgroup/cgconfig.confd
@@ -0,0 +1,4 @@
+# /etc/conf.d/cgconfig: config file for /etc/init.d/cgconfig
+
+# Configuration file location
+#CONFIG_FILE=/etc/cgroup/cgconfig.conf
diff --git a/unmaintained/libcgroup/cgconfig.initd b/unmaintained/libcgroup/cgconfig.initd
new file mode 100644
index 000000000..ae64ae161
--- /dev/null
+++ b/unmaintained/libcgroup/cgconfig.initd
@@ -0,0 +1,120 @@
+#!/sbin/openrc-run
+#
+# Control Groups Configuration Startup
+#
+# This script runs the cgconfigparser utility to parse and setup
+# the control group filesystem. It uses ${CONFIG_FILE}
+# and parses the configuration specified in there.
+#
+CGCONFIGPARSER="/usr/sbin/cgconfigparser"
+CGROUP_FS="cgroup"
+CONFIG_FILE=${CONFIG_FILE:-"/etc/cgconfig.conf"}
+MOUNTS_FILE="/proc/mounts"
+RULES_FILE="/etc/cgrules.conf"
+
+# Support multiple mount points
+MOUNT_POINTS=
+
+move_all_to_init_class() {
+ local i
+ for i in $MOUNT_POINTS; do
+ local mount_point=${i%:*}
+ cd ${mount_point}
+
+ if grep -qw "${mount_point}" ${MOUNTS_FILE}; then
+ local directory
+ for directory in $(find . -depth -type d); do
+ if [ "${directory}" != "." ]; then
+ # cat fails with "Argument list too long" error
+ sed -nu p < ${directory}/tasks > tasks
+ rmdir ${directory}
+ fi
+ done
+ else
+ ewarn "Resource control filesystem not mounted"
+ fi
+
+ cd - >/dev/null
+ done
+}
+
+parse_mounts() {
+ local device mount_point fs_type options other
+ while read device mount_point fs_type options other; do
+ if echo ${CGROUP_FS} | grep -q ${device}; then
+ MOUNT_POINTS="${MOUNT_POINTS} ${mount_point}:${options}"
+ fi
+ done < ${MOUNTS_FILE}
+}
+
+umount_fs() {
+ local i
+ for i in ${MOUNT_POINTS}; do
+ umount ${i%:*}
+ rmdir ${i%:*}
+ done
+}
+
+depend() {
+ need local
+}
+
+start() {
+ ebegin "Starting cgconfig service"
+
+ # Mount filesystem and create cgroups
+ if ! ${CGCONFIGPARSER} -l ${CONFIG_FILE} >/dev/null; then
+ eend 1 "Failed to parse ${CONFIG_FILE}"
+ return 1
+ fi
+
+ parse_mounts
+
+ # Find default cgroup name in rules file
+ local default_cgroup
+ if [ -f "${RULES_FILE}" ]; then
+ default_cgroup=$(awk '$1 == "*" {print $3; exit}' ${RULES_FILE})
+ if [ $default_cgroup == "*" ]; then
+ ewarn "${RULES_FILE} incorrect"
+ ewarn "Overriding it"
+ default_cgroup=
+ fi
+ fi
+ # Use predefined name if none was found
+ if [ -z "${default_cgroup}" ]; then
+ default_cgroup=sysdefault
+ fi
+
+ # Create a default cgroup for tasks to return back to
+ local i
+ for i in $MOUNT_POINTS; do
+ local mount_point=${i%:*}
+ local mount_options=${i#*:}
+ # Ignore if directory already exists
+ mkdir -p ${mount_point}/${default_cgroup}
+ find ${mount_point}/ -name tasks | xargs chmod a+rw
+ chmod go-w ${mount_point}/tasks
+
+ # Special rule for cpusets
+ if echo ${mount_options} | grep -qw cpuset; then
+ cat ${mount_point}/cpuset.cpus > ${mount_point}/${default_cgroup}/cpuset.cpus
+ cat ${mount_point}/cpuset.mems > ${mount_point}/${default_cgroup}/cpuset.mems
+ fi
+
+ # Classify everything to default cgroup
+ local j
+ for j in $(ps --no-headers -eL o tid); do
+ echo $j > ${mount_point}/${default_cgroup}/tasks 2>/dev/null
+ done
+ done
+
+ eend 0
+}
+
+stop() {
+ ebegin "Stopping cgconfig service"
+ parse_mounts
+ move_all_to_init_class
+ umount_fs
+ eend 0
+}
diff --git a/unmaintained/libcgroup/cgred.confd b/unmaintained/libcgroup/cgred.confd
new file mode 100644
index 000000000..663ffc0c7
--- /dev/null
+++ b/unmaintained/libcgroup/cgred.confd
@@ -0,0 +1,17 @@
+# /etc/conf.d/cgred.conf: config file for /etc/init.d/cgred
+
+# Uncomment the following line to log to specified file instead of syslog
+#LOG_FILE="/var/log/cgrulesengd.log"
+
+# Uncomment the second line to run CGroup Rules Engine in non-daemon mode
+#NODAEMON=""
+NODAEMON="--nodaemon"
+
+# Uncomment the second line to disable logging for CGroup Rules Engine
+# Uncomment the third line to enable more verbose logging.
+#LOG=""
+LOG="--nolog"
+#LOG="-v"
+
+# PID file
+PID_FILE=/var/run/cgred.pid
diff --git a/unmaintained/libcgroup/cgred.initd b/unmaintained/libcgroup/cgred.initd
new file mode 100644
index 000000000..e5d027f2d
--- /dev/null
+++ b/unmaintained/libcgroup/cgred.initd
@@ -0,0 +1,34 @@
+#!/sbin/openrc-run
+#
+# CGroups Rules Engine Daemon
+#
+# This is a daemon for automatically classifying processes into cgroups based
+# on UID/GID.
+#
+extra_started_commands="reload"
+
+name="CGroup Rules Engine Daemon"
+command="/usr/sbin/cgrulesengd"
+pidfile=${PID_FILE:-"/var/run/cgred.pid"}
+command_args="${NODAEMON} ${LOG}"
+start_stop_daemon_args="--make-pidfile --background --stdout /dev/null"
+
+
+depend() {
+ need cgconfig
+ use logger
+}
+
+start_pre() {
+ if [ -n "${LOG_FILE}" ]; then
+ command_args="${command_args} --log-file=${LOG_FILE}"
+ fi
+}
+
+reload() {
+ ebegin "Reloading ${name}"
+ start-stop-daemon --signal USR2 --pidfile "${pidfile}" \
+ --exec "${command}"
+ eend $?
+}
+
diff --git a/unmaintained/libcgroup/musl-decls-compat.patch b/unmaintained/libcgroup/musl-decls-compat.patch
new file mode 100644
index 000000000..985a22696
--- /dev/null
+++ b/unmaintained/libcgroup/musl-decls-compat.patch
@@ -0,0 +1,207 @@
+commit ca780b4f7f71abeeb04a585f2a4d889caaa985fa
+Author: Isaac Dunham <ibid.ag@gmail.com>
+Date: Fri Sep 5 22:35:32 2014 -0700
+
+ Remove __.*DECLS nonsense
+
+diff --git a/include/libcgroup/config.h b/include/libcgroup/config.h
+index 2dfdd32..859f7b5 100644
+--- a/include/libcgroup/config.h
++++ b/include/libcgroup/config.h
+@@ -9,7 +9,9 @@
+ #include <features.h>
+ #endif
+
+-__BEGIN_DECLS
++#ifdef __cplusplus
++extern "C" {
++#endif
+
+ /**
+ * @defgroup group_config 5. Configuration
+@@ -77,6 +79,8 @@ int cgroup_config_set_default(struct cgroup *new_default);
+ * @}
+ * @}
+ */
+-__END_DECLS
++#ifdef __cplusplus
++}
++#endif
+
+ #endif /*_LIBCGROUP_CONFIG_H*/
+diff --git a/include/libcgroup/error.h b/include/libcgroup/error.h
+index 91b5c1c..02115f5 100644
+--- a/include/libcgroup/error.h
++++ b/include/libcgroup/error.h
+@@ -9,7 +9,9 @@
+ #include <features.h>
+ #endif
+
+-__BEGIN_DECLS
++#ifdef __cplusplus
++extern "C" {
++#endif
+
+ /**
+ * @defgroup group_errors 6. Error handling
+@@ -104,6 +106,8 @@ int cgroup_get_last_errno(void);
+ * @}
+ * @}
+ */
+-__END_DECLS
++#ifdef __cplusplus
++}
++#endif
+
+ #endif /* _LIBCGROUP_INIT_H */
+diff --git a/include/libcgroup/groups.h b/include/libcgroup/groups.h
+index 39596a1..451fbbd 100644
+--- a/include/libcgroup/groups.h
++++ b/include/libcgroup/groups.h
+@@ -11,7 +11,9 @@
+ #include <stdbool.h>
+ #endif
+
+-__BEGIN_DECLS
++#ifdef __cplusplus
++extern "C" {
++#endif
+
+ /**
+ * Flags for cgroup_delete_cgroup_ext().
+@@ -570,6 +572,8 @@ int cg_chmod_recursive(struct cgroup *cgroup, mode_t dir_mode,
+ */
+
+
+-__END_DECLS
++#ifdef __cplusplus
++}
++#endif
+
+ #endif /* _LIBCGROUP_GROUPS_H */
+diff --git a/include/libcgroup/init.h b/include/libcgroup/init.h
+index 3709096..8ef69ec 100644
+--- a/include/libcgroup/init.h
++++ b/include/libcgroup/init.h
+@@ -9,7 +9,9 @@
+ #include <features.h>
+ #endif
+
+-__BEGIN_DECLS
++#ifdef __cplusplus
++extern "C" {
++#endif
+
+ /**
+ * @defgroup group_init 1. Initialization
+@@ -54,6 +56,8 @@ int cgroup_get_subsys_mount_point(const char *controller, char **mount_point);
+ * @}
+ * @}
+ */
+-__END_DECLS
++#ifdef __cplusplus
++}
++#endif
+
+ #endif /* _LIBCGROUP_INIT_H */
+diff --git a/include/libcgroup/iterators.h b/include/libcgroup/iterators.h
+index c6d453d..fb47d01 100644
+--- a/include/libcgroup/iterators.h
++++ b/include/libcgroup/iterators.h
+@@ -11,7 +11,9 @@
+ #include <features.h>
+ #endif
+
+-__BEGIN_DECLS
++#ifdef __cplusplus
++extern "C" {
++#endif
+
+ /**
+ * @defgroup group_iterators 3. Iterators
+@@ -423,6 +425,8 @@ int cgroup_get_subsys_mount_point_end(void **handle);
+ * @}
+ */
+
+-__END_DECLS
++#ifdef __cplusplus
++}
++#endif
+
+ #endif /* _LIBCGROUP_ITERATORS_H */
+diff --git a/include/libcgroup/tasks.h b/include/libcgroup/tasks.h
+index fb728f4..2f2e486 100644
+--- a/include/libcgroup/tasks.h
++++ b/include/libcgroup/tasks.h
+@@ -12,7 +12,9 @@
+ #include <stdbool.h>
+ #endif
+
+-__BEGIN_DECLS
++#ifdef __cplusplus
++extern "C" {
++#endif
+
+ /** Flags for cgroup_change_cgroup_uid_gid(). */
+ enum cgflags {
+@@ -189,6 +191,8 @@ int cgroup_register_unchanged_process(pid_t pid, int flags);
+ * @}
+ * @}
+ */
+-__END_DECLS
++#ifdef __cplusplus
++}
++#endif
+
+ #endif /* _LIBCGROUP_TASKS_H */
+diff --git a/src/daemon/cgrulesengd.h b/src/daemon/cgrulesengd.h
+index 97c62f1..23607d0 100644
+--- a/src/daemon/cgrulesengd.h
++++ b/src/daemon/cgrulesengd.h
+@@ -17,7 +17,9 @@
+
+ #include <features.h>
+
+-__BEGIN_DECLS
++#ifdef __cplusplus
++extern "C" {
++#endif
+
+ #include "config.h"
+ #include "libcgroup.h"
+@@ -112,7 +114,9 @@ void cgre_flash_rules(int signum);
+ */
+ void cgre_catch_term(int signum);
+
+-__END_DECLS
++#ifdef __cplusplus
++}
++#endif
+
+ #endif /* _CGRULESENGD_H */
+
+diff --git a/src/libcgroup-internal.h b/src/libcgroup-internal.h
+index b9d7b6b..46d1f56 100644
+--- a/src/libcgroup-internal.h
++++ b/src/libcgroup-internal.h
+@@ -16,7 +16,9 @@
+
+ #define __LIBCG_INTERNAL
+
+-__BEGIN_DECLS
++#ifdef __cplusplus
++extern "C" {
++#endif
+
+ #include "config.h"
+ #include <fts.h>
+@@ -269,6 +271,8 @@ extern void cgroup_dictionary_iterator_end(void **handle);
+ */
+ int cg_chmod_path(const char *path, mode_t mode, int owner_is_umask);
+
+-__END_DECLS
++#ifdef __cplusplus
++}
++#endif
+
+ #endif