Bug 1435142

Summary: Cannot create scope with user service manager
Product: [Fedora] Fedora Reporter: Lukas Slebodnik <lslebodn>
Component: systemdAssignee: systemd-maint
Status: CLOSED EOL QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 27CC: antoine, fat.lobyte9, johannbg, lnykryn, msekleta, muadda, ssahani, s, systemd-maint, zbyszek
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-11-30 21:44:48 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
strace output none

Description Lukas Slebodnik 2017-03-23 09:16:30 UTC
Description of problem:
I tried to create scope in user session; so I can kill it in case of leftover process. (That's part of development on my custom project).

The reproducer is the same as in BZ1413075. Is it so difficult to test such simple case?

Version-Release number of selected component (if applicable):
sh$ rpm -q systemd
systemd-233-3.fc26.x86_64

sh$ uname -a
Linux vm-058-237.abc.idm.lab.eng.brq.redhat.com 4.11.0-0.rc3.git0.1.fc26.x86_64 #1 SMP Mon Mar 20 15:55:57 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux


How reproducible:
deterministic

Steps to Reproduce:
1. systemd-run --user --scope --unit=testtt -- bash

Actual results:
Job for testtt.scope failed.
See "systemctl status testtt.scope" and "journalctl -xe" for details.

Expected results:
bash is executed

Additional info:
//journal says

Mar 23 10:14:40 vm-058-237.example.com systemd[63838]: testtt.scope: Failed to add PIDs to scope's control group: Permission denied
Mar 23 10:14:40 vm-058-237.example.com systemd[63838]: Failed to start /usr/bin/bash.
Mar 23 10:14:40 vm-058-237.example.com systemd[63838]: testtt.scope: Unit entered failed state.

Comment 1 Lukas Slebodnik 2017-03-23 09:20:11 UTC
Created attachment 1265653 [details]
strace output

Comment 2 Lukas Slebodnik 2017-04-03 19:44:25 UTC
Zbigniew,
I know you do not like needinfo but I do not not get your attention.

Comment 3 Lukas Slebodnik 2017-05-18 15:31:12 UTC
BTW it is obvious that it fails because directory is created with wrong permissions

sh$ namei -mo /sys/fs/cgroup/pids/user.slice/user-20728.slice/user/testttt.scope
f: /sys/fs/cgroup/pids/user.slice/user-20728.slice/user/testttt.scope
 dr-xr-xr-x root root /
 dr-xr-xr-x root root sys
 drwxr-xr-x root root fs
 drwxr-xr-x root root cgroup
 dr-xr-xr-x root root pids
 drwxr-xr-x root root user.slice
 drwxr-xr-x root root user-20728.slice
 drwxr-xr-x root root user
                      testttt.scope - No such file or directory

sh$ grep EACC systemd.log 
mkdir("/sys/fs/cgroup/pids/user.slice/user-20728.slice/user/testttt.scope", 0755) = -1 EACCES (Permission denied)

Comment 4 Antoine Martin 2017-05-18 15:33:57 UTC
This looks like the upstream bug doesn't it?
https://github.com/systemd/systemd/issues/3388

Comment 5 Lukas Slebodnik 2017-05-18 19:58:32 UTC
It is possible

sh# uname -r
4.11.0-2.fc26.x86_64

sh# grep cgroup /proc/self/mounts | grep unified
cgroup /sys/fs/cgroup/unified cgroup2 rw,nosuid,nodev,noexec,relatime 0 0

Comment 6 Lukas Slebodnik 2017-07-18 17:53:07 UTC
Do you have an idea why this systemd feature is not a priority for fedora/upstream? Because it does not work in f26+ and it is not fixed in oone of newst builds in rawhide systemd-234-1.fc27.

Is it a deprecated feature?

Comment 7 Michal Sekletar 2017-07-19 09:46:52 UTC
(In reply to Lukas Slebodnik from comment #6)
> Do you have an idea why this systemd feature is not a priority for
> fedora/upstream? Because it does not work in f26+ and it is not fixed in
> oone of newst builds in rawhide systemd-234-1.fc27.

In systemd as in any other open source project there are outstanding bugs just because so far there was no one who had enough time/motivation/knowledge to actually sit down and fix them. systemd is no exception here.

> 
> Is it a deprecated feature?

It is not. Unfortunately it doesn't work yet with hybrid cgroup hierarchy. As a workaround please revert to using legacy cgroup layout. Use following commands to do that and reboot.

grubby --update-kernel /boot/vmlinuz-$(uname -r) --args systemd.legacy_systemd_cgroup_controller=1

grubby --update-kernel /boot/vmlinuz-$(uname -r) --args systemd.unified_cgroup_hierarchy=0

Comment 8 Lukas Slebodnik 2017-07-19 11:06:38 UTC
Thank you very much for provided workaround. I added these options to GRUB_CMDLINE_LINUX in /etc/sysconfig/grub.

And good to know that it is not deprecated feature :-)

Comment 9 Fedora End Of Life 2018-05-03 08:39:58 UTC
This message is a reminder that Fedora 26 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 26. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora  'version'
of '26'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version'
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not
able to fix it before Fedora 26 is end of life. If you would still like
to see this bug fixed and are able to reproduce it against a later version
of Fedora, you are encouraged  change the 'version' to a later Fedora
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's
lifetime, sometimes those efforts are overtaken by events. Often a
more recent Fedora release includes newer upstream software that fixes
bugs or makes them obsolete.

Comment 10 Lukas Slebodnik 2018-05-26 14:28:43 UTC
Reproducible even on f27

Comment 11 Ben Cotton 2018-11-27 15:36:14 UTC
This message is a reminder that Fedora 27 is nearing its end of life.
On 2018-Nov-30  Fedora will stop maintaining and issuing updates for
Fedora 27. It is Fedora's policy to close all bug reports from releases
that are no longer maintained. At that time this bug will be closed as
EOL if it remains open with a Fedora  'version' of '27'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 27 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 12 Ben Cotton 2018-11-30 21:44:48 UTC
Fedora 27 changed to end-of-life (EOL) status on 2018-11-30. Fedora 27 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.