aboutsummaryrefslogtreecommitdiff
path: root/sh/rc-cgroup.sh.in
AgeCommit message (Collapse)Author
2017-09-29use printf consistently in cgroups handlingWilliam Hubbs
This makes the cgroups handling consistent between cgroups v1 and v2. Also, it fixes #167.
2017-09-16cgroup2_find_path: use legacy mode if cgroup2 is not in the kernelWilliam Hubbs
This is related to #164.
2017-09-15cgroup_cleanup: try to remove the cgroup version 2 cgroupWilliam Hubbs
If we were able to kill all the processes in the cgroup, it should be removed.
2017-09-15rc-cgroup.sh: cgroup_cleanup fix error handlingWilliam Hubbs
cgroup_cleanup should warn if it is unable to clean up all processes in the control group, but it will always return success.
2017-09-15rc-cgroup.sh: fix signal namesWilliam Hubbs
The "SIG" prefix on signal names passed to kill -s isn't portable.
2017-09-14make the procedure for killing child processes of services configurableWilliam Hubbs
2017-09-14Make cgroup_cleanup send only one sigterm and sigkillWilliam Hubbs
Instead of looping and sending multiple signals to child processes in cgroup_cleanup, we send sigterm followed by sleeping one second then sigkill. This brings us more in line with systemd's "control group" killmode setting. Also, this commit includes several shellcheck cleanups.
2017-09-14rc-cgroup.sh: move cgroup_cleanup to the end of the fileWilliam Hubbs
2017-09-14add support for control groups version 2William Hubbs
This is for #94.
2016-09-14Fix permission checks for cgroupsWilliam Hubbs
This is needed because containers may give read access to cgroups but not allow the settings to be changed.
2015-12-21Convert OpenRC to a centralized copyright/license structureWilliam Hubbs
In the past, OpenRC was a hybrid of a centralized and file-scope license/copyright structure. I followed the instructions from the Software Freedom Law Center [1] to convert to a Centralized structure where possible, for easier future maintenance. [1] https://softwarefreedom.org/resources/2012/ManagingCopyrightInformation.html
2015-10-06cgroups: Add the hugetlb, net_cls and pids controllersAustin S. Hemmelgarn
Note from WilliamH: I slightly rearranged the code and added the settings in rc.conf. X-Gentoo-Bug: 555488 X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=555488
2015-10-06rc-cgroup.sh: Do not add leading spaces to cgroup valuesWilliam Hubbs
We were starting the value we write to the cgroup setting file with leading spaces and this was causing issues. This change makes sure that we aren't adding leading spaces to the value. X-Gentoo-Bug: 562354 X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=562354
2015-04-21cgroups: use printf to write to cgroup filesWilliam Hubbs
This fixes #33.
2015-01-12Add description for cgroup_cleanupWilliam Hubbs
X-Gentoo-Bug: 535184 X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=535184
2013-09-27fix cgroup_cleanup functionWilliam Hubbs
The yesno test for rc_cgroup_cleanup belongs at the point where this function is called from runscript, not in the function itself. X-Gentoo-Bug: 486210 X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=486210
2013-07-25rc-cgroup: make sure the tasks file exists before adding the pidWilliam Hubbs
2013-07-05cgroups: change '$$' to 0 for consistencyWilliam Hubbs
2013-07-05Merge branch 'cgroup.systemd'William Hubbs
Conflicts: sh/rc-cgroup.sh.in
2013-07-01Put a service on into a top hierarchy of each cgroupAlexander V Vershilov
This change will fix unwanted cgroup inheriting from user cgroups, and fixes issues with systemd cgroup tracking by logind. However this fix can lead to incorrect work for some user cgroup controllers - so more advanced solution, that coveres such cases will be created later. Thanks to Fabio Erculiani (lxnay) for testing and general idea.
2013-06-25cgroups: add support for systemd cgroup hierarchyWilliam Hubbs
The systemd cgroup hierarchy support is being added so we can run logind outside of systemd. This is needed because software that was using consolekit is now migrating to logind. We do not create this hierarchy, we just add services to it if it exists.
2013-06-16cgroups: hide messages about non-existent processesAlexander V Vershilov
2013-05-25rc_cgroup.sh: fix typoAlexander V Vershilov
This fixes an incorrect variable assignment in cgroup_get_pids
2013-04-25add cgroup cleanup supportAlexander Vershilov
This adds the ability to kill all processes within a service's cgroup when that service is stopped or restarted.
2013-02-19cgroups: major update to cgroups supportWilliam Hubbs
This reworks cgroups support so we have one variable in rc.conf for each controller instead of each setting. Also we add support for all of the possible cgroup controllers. I would like to thank Alexander Vershilov for his help with testing and reworking this code.
2013-02-19cgroups: fix shebang line in rc-cgroup.shWilliam Hubbs
2013-02-16Add module for cgroup processingAlexander Vershilov
sh/rc-cgroup.sh.in: new script to handle cgroup processing sh/rc-cgroup.sh.in: do not use grep or cut (modification by William Hubbs) sh/runscript.sh.in: use the cgroup script