diff options
author | Patrick J Volkerding <volkerdi@slackware.com> | 2016-06-30 20:26:57 +0000 |
---|---|---|
committer | Eric Hameleers <alien@slackware.com> | 2018-05-31 23:31:18 +0200 |
commit | d31c50870d0bee042ce660e445c9294a59a3a65b (patch) | |
tree | 6bfc0de3c95267b401b620c2c67859557dc60f97 /source/ap/cgmanager/config/rc.cgmanager | |
parent | 76fc4757ac91ac7947a01fb7b53dddf9a78a01d1 (diff) | |
download | current-d31c50870d0bee042ce660e445c9294a59a3a65b.tar.gz |
Slackware 14.2slackware-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! :-)
Diffstat (limited to 'source/ap/cgmanager/config/rc.cgmanager')
-rw-r--r-- | source/ap/cgmanager/config/rc.cgmanager | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/source/ap/cgmanager/config/rc.cgmanager b/source/ap/cgmanager/config/rc.cgmanager new file mode 100644 index 00000000..83c19061 --- /dev/null +++ b/source/ap/cgmanager/config/rc.cgmanager @@ -0,0 +1,56 @@ +#!/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 |