Skip to content

Instantly share code, notes, and snippets.

@xlogerais
Created September 14, 2017 14:03
Show Gist options
  • Select an option

  • Save xlogerais/27c6fda8bb932a9ae4757afc467bae43 to your computer and use it in GitHub Desktop.

Select an option

Save xlogerais/27c6fda8bb932a9ae4757afc467bae43 to your computer and use it in GitHub Desktop.
Gentoo init script cgroup systemd
#!/sbin/openrc-run
# Copyright 1999-2017 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
prepare_mountpoint() {
if ! [ -d /sys/fs/cgroup/systemd ]; then
ebegin "Creating mountpoint /sys/fs/cgroup/systemd"
mkdir -p /sys/fs/cgroup/systemd
eend $?
fi
}
depend() {
before lxcfs
}
start() {
prepare_mountpoint
ebegin "Mounting /sys/fs/cgroup/systemd"
mount -t cgroup -o none,name=systemd systemd /sys/fs/cgroup/systemd
eend $?
}
stop() {
ebegin "Unmounting /sys/fs/cgroup/systemd"
umount /sys/fs/cgroup/systemd
eend $?
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment