File: setup

package info (click to toggle)
libmojo-ioloop-readwriteprocess-perl 1.1.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 540 kB
  • sloc: perl: 4,655; sh: 101; makefile: 2
file content (29 lines) | stat: -rwxr-xr-x 629 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/bin/bash

# Courtesy of https://github.com/sosy-lab/benchexec

echo ------------------------
echo "Existing mount points:"
mount
echo ------------------------
echo "Existing users:"
getent passwd
echo ------------------------

PRIMARY_USER="$1"

# Set up cgroups
for i in blkio cpuacct cpuset freezer memory cpu pids; do
  if [ ! -d "/sys/fs/cgroup/$i" ]; then
    mkdir /sys/fs/cgroup/$i
    mount cgroup-$i /sys/fs/cgroup/$i -t cgroup -o $i
  fi
  chgrp "$(id -g "$PRIMARY_USER")" /sys/fs/cgroup/$i
  chmod g+rwx /sys/fs/cgroup/$i
done

echo ------------------------
echo "Now mount points:"
mount

ls -liah /sys/fs/cgroup/