Bug 1412468
Summary: | vncserver errors when starting under selinux following the draft Fedora 25 system administrators guide | ||
---|---|---|---|
Product: | [Fedora] Fedora | Reporter: | Neil Squires <neil> |
Component: | tigervnc | Assignee: | Jan Grulich <jgrulich> |
Status: | CLOSED EOL | QA Contact: | Fedora Extras Quality Assurance <extras-qa> |
Severity: | low | Docs Contact: | |
Priority: | unspecified | ||
Version: | 25 | CC: | accounts, alessandro.suardi, bphinz, jgrulich, khua, markus.hillig, twaugh |
Target Milestone: | --- | ||
Target Release: | --- | ||
Hardware: | x86_64 | ||
OS: | Linux | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | If docs needed, set a value | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2017-12-12 10:07:19 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
Neil Squires
2017-01-12 05:44:43 UTC
A copy of the selinux permissions from the users home directory # ls -laZ /home/nfsquires/.vnc* total 20 drwxrwxr-x. 2 nfsquires nfsquires unconfined_u:object_r:user_home_t:s0 112 Jan 12 15:40 . drwx------. 3 nfsquires nfsquires unconfined_u:object_r:user_home_dir_t:s0 114 Jan 12 15:40 .. -rw-r--r--. 1 nfsquires nfsquires system_u:object_r:user_home_t:s0 332 Jan 12 13:17 config -rw-------. 1 nfsquires nfsquires unconfined_u:object_r:user_home_t:s0 8 Jan 12 13:16 passwd -rw-r--r--. 1 nfsquires nfsquires system_u:object_r:user_home_t:s0 616 Jan 12 15:40 vpn.squires.id.au:1.log -rw-r--r--. 1 nfsquires nfsquires system_u:object_r:user_home_t:s0 5 Jan 12 15:40 vpn.squires.id.au:1.pid -rwxr-xr-x. 1 nfsquires nfsquires system_u:object_r:user_home_t:s0 92 Jan 12 13:17 xstartup With setenforce 1 and restarting the service Jan 12 17:53:42 vpn.squires.id.au systemd[1]: Stopping Remote desktop service (VNC)... -- Subject: Unit vncserver@:1.service has begun shutting down -- Defined-By: systemd -- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel -- -- Unit vncserver@:1.service has begun shutting down. Jan 12 17:53:42 vpn.squires.id.au vncserver[4436]: Killing Xvnc process ID 4378 Jan 12 17:53:42 vpn.squires.id.au audit[1]: AVC avc: denied { read } for pid=1 comm="systemd" name="vpn.squires.id.au:1.pid" dev="dm-0" ino=25247161 scontext=system_u:system_r:init_t:s0 tcontext=system_u: Jan 12 17:53:43 vpn.squires.id.au systemd[1]: Stopped Remote desktop service (VNC). -- Subject: Unit vncserver@:1.service has finished shutting down -- Defined-By: systemd -- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel -- -- Unit vncserver@:1.service has finished shutting down. Jan 12 17:53:43 vpn.squires.id.au audit[1]: SERVICE_STOP pid=1 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:init_t:s0 msg='unit=vncserver@:1 comm="systemd" exe="/usr/lib/systemd/systemd" hostn Jan 12 17:53:43 vpn.squires.id.au systemd[1]: Starting Remote desktop service (VNC)... -- Subject: Unit vncserver@:1.service has begun start-up -- Defined-By: systemd -- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel -- -- Unit vncserver@:1.service has begun starting up. Jan 12 17:53:43 vpn.squires.id.au vncserver[4447]: Can't find file /home/nfsquires/.vnc/vpn.squires.id.au:1.pid Jan 12 17:53:43 vpn.squires.id.au vncserver[4447]: You'll have to kill the Xvnc process manually Jan 12 17:53:46 vpn.squires.id.au vncserver[4451]: New 'vpn.squires.id.au:1 (nfsquires)' desktop is vpn.squires.id.au:1 Jan 12 17:53:46 vpn.squires.id.au vncserver[4451]: Starting applications specified in /home/nfsquires/.vnc/xstartup Jan 12 17:53:46 vpn.squires.id.au vncserver[4451]: Log file is /home/nfsquires/.vnc/vpn.squires.id.au:1.log Jan 12 17:53:46 vpn.squires.id.au audit[1]: AVC avc: denied { read } for pid=1 comm="systemd" name="vpn.squires.id.au:1.pid" dev="dm-0" ino=25247160 scontext=system_u:system_r:init_t:s0 tcontext=system_u: Jan 12 17:53:46 vpn.squires.id.au audit[1]: AVC avc: denied { read } for pid=1 comm="systemd" name="vpn.squires.id.au:1.pid" dev="dm-0" ino=25247160 scontext=system_u:system_r:init_t:s0 tcontext=system_u: Jan 12 17:53:46 vpn.squires.id.au audit[1]: AVC avc: denied { read } for pid=1 comm="systemd" name="vpn.squires.id.au:1.pid" dev="dm-0" ino=25247160 scontext=system_u:system_r:init_t:s0 tcontext=system_u: Jan 12 17:53:46 vpn.squires.id.au systemd[1]: vncserver@:1.service: PID file /home/nfsquires/.vnc/vpn.squires.id.au:1.pid not readable (yet?) after start: Permission denied Jan 12 17:53:47 vpn.squires.id.au dbus-daemon[4475]: [session uid=1000 pid=4473] Activating service name='org.freedesktop.systemd1' requested by ':1.0' (uid=1000 pid=4477 comm="systemctl --user import-enviro Jan 12 17:53:47 vpn.squires.id.au dbus-daemon[4475]: [session uid=1000 pid=4473] Activated service 'org.freedesktop.systemd1' failed: Process org.freedesktop.systemd1 exited with status 1 Jan 12 17:55:14 vpn.squires.id.au systemd[1]: vncserver@:1.service: Start operation timed out. Terminating. Jan 12 17:55:17 vpn.squires.id.au audit[1]: SERVICE_START pid=1 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:init_t:s0 msg='unit=vncserver@:1 comm="systemd" exe="/usr/lib/systemd/systemd" host Jan 12 17:55:17 vpn.squires.id.au audit[1]: AVC avc: denied { unlink } for pid=1 comm="systemd" name="vpn.squires.id.au:1.pid" dev="dm-0" ino=25247160 scontext=system_u:system_r:init_t:s0 tcontext=system_ Jan 12 17:55:17 vpn.squires.id.au systemd[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. Jan 12 17:55:17 vpn.squires.id.au systemd[1]: vncserver@:1.service: Unit entered failed state. Jan 12 17:55:17 vpn.squires.id.au systemd[1]: vncserver@:1.service: Failed with result 'timeout'. After installing the selinux tools, I ran # ausearch -c 'systemd' --raw | audit2allow -M my-systemd The result .te was module my-systemd 1.0; require { type init_t; type unconfined_service_t; type user_home_t; type admin_home_t; class unix_stream_socket create; class file { open read unlink }; } #============= init_t ============== allow init_t admin_home_t:file { read unlink }; allow init_t unconfined_service_t:unix_stream_socket create; allow init_t user_home_t:file { open read unlink }; I installed the resultant my-systemd.pp # semodule -i my-systemd.pp dropped back to the user and started the vncserver $ sudo systemctl restart vncserver@:1.service The service started. I was able to get vncserver properly start vi systemd after applying Neil's semodule. However, I also had to add "Environment=XDG_SESSION_TYPE=x11" to the [Service]. If I didn't add the environment variable, all I got was a black screen. Fedora 26 here (coming from successful upgrades since F22 IIRC), vncserver worked fine until I moved from nouveau to NVidia drivers to avoid overheating of my Aspire Revo R3600 GPU. XFCE4 desktop. Black screen for vncserver upon reboot, as in Kent's comment. Originally files in ~/.vnc for my user mislabeled as root_home_t - restorecon -R of ~/.vnc brings them back to user_home_t. Still black screen. Mini-semodule solution, as in Neil's example, to address missing read permissions on vncserver .pid file: module my-systemd 1.0; require { type user_home_t; type init_t; class file { read unlink }; } #============= init_t ============== allow init_t user_home_t:file { read unlink }; And that fixed it for me - no need to add XDG_SESSION_TYPE=x11 (I would have had to look up where to add that entry, as I don't know where it should go). This message is a reminder that Fedora 25 is nearing its end of life. Approximately 4 (four) weeks from now Fedora will stop maintaining and issuing updates for Fedora 25. 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 '25'. 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 25 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. Fedora 25 changed to end-of-life (EOL) status on 2017-12-12. Fedora 25 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. |