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
MAX_PROCESS_LIMIT=10 | |
systemctl status user.slice | | |
egrep "user-[0-9]+\.slice" | | |
sed 's/.*user-\([0-9]*\).*/\1/' | # get uid | |
while read uid; do | |
test $uid -ne 0 && ( # ignore root | |
tasks=$( | |
systemctl status user-${uid}.slice | | |
grep -e Tasks 2>&1 | | |
sed 's/\w*Tasks: \([1-9][0-9]*\) (limit: [0-9]*)/\1/' |