Bug 1393923

Summary: My system is booting with /dev/ptmx -> /dev/pts/ptmx for some strange reason.
Product: [Fedora] Fedora Reporter: Daniel Walsh <dwalsh>
Component: systemdAssignee: systemd-maint
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: 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: 2016-11-12 12:05:44 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:

Description Daniel Walsh 2016-11-10 16:03:58 UTC
Could this be a systemd bug?

I see some code inside of systemd that does this when running containers.

rpm -q systemd
systemd-231-11.fc26.x86_64

uname -r
4.9.0-0.rc4.git0.1.1.secnext.fc26.x86_64


Only started happening a few days ago, but not sure if I had not rebooted for a while.

Comment 1 Daniel Walsh 2016-11-10 16:04:41 UTC
When this happens all pseudo terminals start getting permission denied.

Comment 2 Zbigniew Jędrzejewski-Szmek 2016-11-10 19:38:27 UTC
Systemd does that when starting service with PrivateDevices=yes. 

# /etc/systemd/system/test-ptmx.service
[Unit]

[Service]
ExecStart=/bin/ls -l /dev/ptmx /dev/pts/ptmx
PrivateDevices=yes

Nov 10 14:35:12 laptop ls[25739]: lrwxrwxrwx. 1 root root    8 Nov 10 14:35 /dev/ptmx -> pts/ptmx
Nov 10 14:35:12 laptop ls[25739]: c---------. 1 root root 5, 2 Nov 10 00:19 /dev/pts/ptmx

Is it possible that you are running from inside such a service? If not, do you have any such services running (systemd-hostnamed,journal-remote,journal-gatewayd,journal-upload,localed,resolved,timesyncd), and this somehow "leaked" through some namespace screwup?

Comment 3 Daniel Walsh 2016-11-12 11:51:51 UTC
Not sure what it would mean to boot the system from within a service.

Here is all the PrivateDev that I see.

 grep -i PrivateDev -r /etc/systemd/ /lib/systemd/
Binary file /lib/systemd/libsystemd-shared-231.so matches
Binary file /lib/systemd/systemd matches
/lib/systemd/system/systemd-hostnamed.service:PrivateDevices=yes
/lib/systemd/system/mlocate-updatedb.service:PrivateDevices=true
/lib/systemd/system/systemd-localed.service:PrivateDevices=yes
/lib/systemd/system/systemd-timesyncd.service:PrivateDevices=yes

Does systemd do this if it thinks that it is running inside of a container?

Comment 4 Daniel Walsh 2016-11-12 12:05:44 UTC
Found the problem.  Systemd is not related. Sorry for bothering you.