1
0
Fork 0
mirror of git://slackware.nl/current.git synced 2025-01-30 08:38:10 +01:00
slackware-current/source/ap/cgmanager/config/rc.cgmanager
Patrick J Volkerding d31c50870d Slackware 14.2
Thu Jun 30 20:26:57 UTC 2016
Slackware 14.2 x86_64 stable is released!

The long development cycle (the Linux community has lately been living in
"interesting times", as they say) is finally behind us, and we're proud to
announce the release of Slackware 14.2.  The new release brings many updates
and modern tools, has switched from udev to eudev (no systemd), and adds
well over a hundred new packages to the system.  Thanks to the team, the
upstream developers, the dedicated Slackware community, and everyone else
who pitched in to help make this release a reality.

The ISOs are off to be replicated, a 6 CD-ROM 32-bit set and a dual-sided
32-bit/64-bit x86/x86_64 DVD.  Please consider supporting the Slackware
project by picking up a copy from store.slackware.com.  We're taking
pre-orders now, and offer a discount if you sign up for a subscription.

Have fun!  :-)
2018-05-31 23:31:18 +02:00

56 lines
1.4 KiB
Bash

#!/bin/sh
# /etc/rc.d/rc.cgmanager - start/stop the cgroup manager
if [ -f /etc/default/cgmanager ]; then
# get cgmanager options if specified
. /etc/default/cgmanager
fi
start_cgmanager() {
# Kill any existing cgproxy
/bin/sh /etc/rc.d/rc.cgproxy stop >/dev/null 2>&1 || true
# check whether to start cgproxy or cgmanager
if /usr/sbin/cgproxy --check-master; then
if [ -x /etc/rc.d/rc.cgproxy -a ! -r /run/cgmanager.pid ]; then
NESTED=yes /etc/rc.d/rc.cgproxy start || true && { exit 0; }
else
# If we are here, either cgmanager is already running (in which case
# we don't want to run it again), or rc.cgproxy is not executable
# (in which case we don't want to run it).
echo "Error: rc.cgproxy is not executable, or attempting to start multiple instances of cgmanager"
exit 1
fi
fi
echo "Starting cgmanager: /usr/sbin/cgmanager --daemon"
/usr/sbin/cgmanager --daemon
}
stop_cgmanager() {
# If the cgmanager stops, the proxy must also stop
/bin/sh /etc/rc.d/rc.cgproxy stop >/dev/null 2>&1 || true
echo "Stopping cgmanager."
/bin/kill $(cat /run/cgmanager.pid 2>/dev/null) 2>/dev/null
/usr/bin/pkill cgmanager 2>/dev/null
rm -f /run/cgmanager.pid
}
restart_cgmanager() {
stop_cgmanager
sleep 1
start_cgmanager
}
case "$1" in
'start')
start_cgmanager
;;
'stop')
stop_cgmanager
;;
'restart')
restart_cgmanager
;;
*)
echo "usage $0 start|stop|restart"
esac