Description of problem: At the moment harness runs in SysV compatible mode under systemd. There is no systemd unit file, where we could change systemd defaults. So in automated beaker environment we have tests using cpu cgroup like: cpu:/system/beah-srv.service and when running same test in shell (ssh), it's root cpu cgroup cpu:/ This difference is making some tests to fail in beaker, while they work perfectly OK when run manually, for example sched_rr_ tests from LTP (fail at http://lxr.linux.no/#linux+v3.2/kernel/sched.c#L5353). [1] http://www.freedesktop.org/wiki/Software/systemd/PaxControlGroups By default systemd will place services only in automatic cgroups in the "cpu" hierarchy and in its own private tree "name=systemd". [2] http://comments.gmane.org/gmane.comp.sysutils.systemd.devel/1231 Note that pam_systemd in git now explicitly resets the "cpu" cgroup of all sessions to the root group since otherwise RT scheduling will not be available for any user daemons. It should be easy to workaround this issue in test, I'm submitting this report for consideration about general solution if/when harness will have its own systemd unit file one day. Then adding following to systemd unit file should take care of it: ControlGroup=cpu:/ Version-Release number of selected component (if applicable): beah-0.6.35-1.fc14.noarch systemd-37-3.fc16.x86_64 Fedora 16 How reproducible: 100% Steps to Reproduce: 1. cat > /root/setscheduler.c <<EOF #include <sched.h> int main() { struct sched_param s = { .sched_priority = 1 }; return sched_setscheduler(0, SCHED_RR, &s); } EOF gcc /root/setscheduler.c -o /root/setscheduler 2. cat > /root/test.sh <<EOF #!/bin/bash strace -f -F -v /root/setscheduler &> /root/data.txt EOF 3. running from shell is OK chmod a+x /root/test.sh /root/test.sh tail /root/data.txt | grep sched_setscheduler > sched_setscheduler(0, SCHED_RR, { 1 }) = 0 4. running as SysV service with systemd defaults fails ln -s /root/test.sh /etc/init.d/test systemctl --system daemon-reload systemctl restart test.service tail /root/data.txt | grep sched_setscheduler > sched_setscheduler(0, SCHED_RR, { 1 }) = -1 EPERM (Operation not permitted) Actual results: tests are run in non-root cpu cgroup Expected results: tests run in root cpu cgroup Additional info:
(In reply to comment #0) > It should be easy to workaround this issue in test The workaround we have in place now, is to check /proc/self/cgroup, find cpu cgroup mount point, and move process running runtest.sh to root cpu cgroup: echo $$ > $cpu_cgroup_mnt/tasks
Marian, If 0.8.2 is an issue let me know
http://gerrit.beaker-project.org/1259
Beaker 0.9.2 has been released.