Created
September 14, 2017 14:03
-
-
Save xlogerais/27c6fda8bb932a9ae4757afc467bae43 to your computer and use it in GitHub Desktop.
Gentoo init script cgroup systemd
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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