Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 1774244

Summary: systemd does not properly start VNC when run via runuser context
Product: Red Hat Enterprise Linux 7 Reporter: Joe Wright <jwright>
Component: systemdAssignee: systemd-maint
Status: CLOSED DUPLICATE QA Contact: Frantisek Sumsal <fsumsal>
Severity: urgent Docs Contact:
Priority: unspecified    
Version: 7.7CC: alanm, casantos, jgrulich, jraising, mkolbas, systemd-maint-list
Target Milestone: rcKeywords: Regression
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-11-20 06:25:13 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:

Description Joe Wright 2019-11-19 20:55:31 UTC
Description of problem:
systemd does not properly start VNC fails, and deletes the pid file, does not kill the started process, and reports failed with the following error:

Nov 19 11:58:05 localhost runuser[18857]: pam_unix(runuser-l:session): session opened for user test by (uid=0)
Nov 19 11:58:05 localhost runuser[18857]: xauth:  file /home/test/.Xauthority does not exist
Nov 19 11:58:08 dhcp-1-183-84.sd.lab.cee.rdu2.redhat.com runuser[18857]: New 'localhost:1 (test)' desktop is localhost:1
Nov 19 11:58:08 localhost runuser[18857]: Creating default config /home/test/.vnc/config
Nov 19 11:58:08 localhost runuser[18857]: Starting applications specified in /home/test/.vnc/xstartup
Nov 19 11:58:08 localhost runuser[18857]: Log file is /home/test/.vnc/localhost:1.log
Nov 19 11:58:08 localhost runuser[18857]: pam_unix(runuser-l:session): session closed for user test
Nov 19 11:58:08 localhost[1]: New main PID 18882 does not belong to service, and PID file is not owned by root. Refusing.
Nov 19 11:58:08 localhost[1]: New main PID 18882 does not belong to service, and PID file is not owned by root. Refusing.
Nov 19 11:58:08 localhost[1]: Failed to start Remote desktop service (VNC).
-- Subject: Unit vncserver@:1.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit vncserver@:1.service has failed.
-- 
-- The result is failed.
Nov 19 11:58:08 localhost systemd[1]: Unit vncserver@:1.service entered failed state.
Nov 19 11:58:08 localhost systemd[1]: vncserver@:1.service failed.

Version-Release number of selected component (if applicable):
systemd-219-67.el7_7.2

How reproducible:


Steps to Reproduce:
1. Install RHEL 7.7
2. Configure VNC per https://access.redhat.com/solutions/966063
3. Attempt to start the daemon

Actual results:
- fails to start

Expected results:
- process starts normally

Additional info:
Supposedly this is related to a change to the runuser context handling in systemd which now requires that the pid file be owned by root, including for processes started via the runuser context, which would not necessarily have the pid file owned by root.

The only realistic workaround that I am aware of is to not update to this version of systemd. There is a kludge that you could do with the unit file that I've hacked together, but I advise against starting VNC instances as a oneshot type.

Comment 5 Jan Grulich 2019-11-20 06:25:13 UTC

*** This bug has been marked as a duplicate of bug 1747191 ***