Browse Source

Fix cgroups-release path and add release script

1.7.1.2
Nathan Owens 8 months ago
parent
commit
7cce2cfe70
  1. 5
      Makefile
  2. 19
      module/boot@/configure/cgroups-release.sh
  3. 2
      module/boot@/configure/cgroups.sh

5
Makefile

@ -42,7 +42,10 @@ $(DESTDIR)$(script_directory)/cgroups.conf: module/boot@/configure/cgroups.conf
$(DESTDIR)$(script_directory)/cgroups.sh: module/boot@/configure/cgroups.sh
exec $(INSTALL) -D -m 755 $< $@
$(DESTDIR)$(script_directory)/%: module/boot@/configure/% $(DESTDIR)$(script_directory)/cgroups.conf $(DESTDIR)$(script_directory)/cgroups.sh
$(DESTDIR)$(script_directory)/cgroups-release.sh: module/boot@/configure/cgroups-release.sh
exec $(INSTALL) -D -m 755 $< $@
$(DESTDIR)$(script_directory)/%: module/boot@/configure/% $(DESTDIR)$(script_directory)/cgroups.conf $(DESTDIR)$(script_directory)/cgroups.sh $(DESTDIR)$(script_directory)/cgroups-release.sh
exec $(INSTALL) -D -m 755 $< $@
sed -i -e "s,@BINDIR@,$(bindir)," $@

19
module/boot@/configure/cgroups-release.sh

@ -0,0 +1,19 @@
#!/bin/sh
# This is run by the kernel after the last task is removed from a
# control group in the openrc hierarchy.
# Copyright (c) 2007-2015 The OpenRC Authors.
# See the Authors file at the top-level directory of this distribution and
# https://github.com/OpenRC/openrc/blob/master/AUTHORS
#
# This file is part of OpenRC. It is subject to the license terms in
# the LICENSE file found in the top-level directory of this
# distribution and at https://github.com/OpenRC/openrc/blob/master/LICENSE
# This file may not be copied, modified, propagated, or distributed
# except according to the terms contained in the LICENSE file.
cgroup=/sys/fs/cgroup/openrc
PATH=/bin:/usr/bin:/sbin:/usr/sbin
if [ -d ${cgroup}/"$1" ]; then
rmdir ${cgroup}/"$1"
fi

2
module/boot@/configure/cgroups.sh

@ -27,7 +27,7 @@ cgroup1_base() {
fi
if ! mountpoint -q /sys/fs/cgroup/openrc; then
local agent="/etc/s6/sv/mount-cgroups/cgroup-release-agent.sh"
local agent="/etc/66/script/cgroups-release.sh"
mkdir /sys/fs/cgroup/openrc
mount -n -t cgroup -o none,${CGROUP_OPTS},name=openrc,release_agent="$agent" openrc /sys/fs/cgroup/openrc
printf 1 > /sys/fs/cgroup/openrc/notify_on_release

Loading…
Cancel
Save