Skip to content

Instantly share code, notes, and snippets.

@FilBot3
Last active September 15, 2020 13:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save FilBot3/aade9936c2714d9b7fb65708b2d7b628 to your computer and use it in GitHub Desktop.
Save FilBot3/aade9936c2714d9b7fb65708b2d7b628 to your computer and use it in GitHub Desktop.
2020-09-15 Fedora 32 failing to start TigerVNC after update becasue of SELinux Policies

TigerVNC Server not starting from SystemD after Fedora32 Update on 2020-09-15

  • I edited the /etc/tigervnc/vncserver.users and added :1=filbot which is my user.
  • I copied /usr/lib/systemd/system/vncserver@.service /etc/systemd/system/vncserver@.service
  • I ran sudo systemctl start vncserver@:1.service
    • It seems to start according to the log, but then immediately dies.
    • ${HOME}/.vnc/${USER}:1.log doesn't seem to show anything related to the crash/termination.

However, I can run the TigerVNC server does run when I do /usr/libexec/vncserver :1. Obviously this isn't the desired operation/result. I don't understand why SystemD, SELinux, and TigerVNC aren't working together.

When I use sudo journalctl -xe --no-page, I can see that the Process dies. However, when I use just sudo journalctl -u vncserver@:1.service --no-page it shows that the process succeeded and is running. Then I use ps aux | grep -i vnc and nothing shows.

Sep 15 07:42:23 fenix sudo[4300]: filbot : TTY=pts/0 ; PWD=/home/filbot ; USER=root ; COMMAND=/usr/bin/systemctl start vncserver@:1.service
Sep 15 07:42:23 fenix audit[4300]: CRED_REFR pid=4300 uid=0 auid=1000 ses=2 subj=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 msg='op=PAM:setcred grantors=pam_env,pam_fprintd acct="root" exe="/usr/bin/sudo" hostname=? addr=? terminal=/dev/pts/0 res=success'
Sep 15 07:42:23 fenix sudo[4300]: pam_unix(sudo:session): session opened for user root by filbot(uid=0)
Sep 15 07:42:23 fenix audit[4300]: USER_START pid=4300 uid=0 auid=1000 ses=2 subj=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 msg='op=PAM:session_open grantors=pam_keyinit,pam_limits,pam_keyinit,pam_limits,pam_systemd,pam_unix acct="root" exe="/usr/bin/sudo" hostname=? addr=? terminal=/dev/pts/0 res=success'
Sep 15 07:42:23 fenix systemd[1]: /etc/systemd/system/vncserver@.service:39: PIDFile= references a path below legacy directory /var/run/, updating /var/run/vncsession-:1.pid → /run/vncsession-:1.pid; please update the unit file accordingly.
Sep 15 07:42:23 fenix systemd[1]: Starting Remote desktop service (VNC)...
-- Subject: A start job for unit vncserver@:1.service has begun execution
-- Defined-By: systemd
-- Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- A start job for unit vncserver@:1.service has begun execution.
--
-- The job identifier is 3476.
Sep 15 07:42:23 fenix audit[4310]: USER_ROLE_CHANGE pid=4310 uid=0 auid=1000 ses=7 subj=system_u:system_r:vnc_session_t:s0 msg='pam: default-context=unconfined_u:unconfined_r:unconfined_t:s0 selected-context=unconfined_u:unconfined_r:unconfined_t:s0 exe="/usr/sbin/vncsession" hostname=203.0.113.20 addr=203.0.113.20 terminal=? res=success'
Sep 15 07:42:23 fenix systemd-logind[1923]: New session 7 of user filbot.
-- Subject: A new session 7 has been created for user filbot
-- Defined-By: systemd
-- Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- Documentation: https://www.freedesktop.org/wiki/Software/systemd/multiseat
--
-- A new session with the ID 7 has been created for the user filbot.
--
-- The leading process of the session is 4310.
Sep 15 07:42:23 fenix systemd[1]: Started Session 7 of user filbot.
-- Subject: A start job for unit session-7.scope has finished successfully
-- Defined-By: systemd
-- Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- A start job for unit session-7.scope has finished successfully.
--
-- The job identifier is 3594.
Sep 15 07:42:23 fenix vncsession[4310]: pam_unix(tigervnc:session): session opened for user filbot by (uid=0)
Sep 15 07:42:23 fenix audit[4310]: USER_START pid=4310 uid=0 auid=1000 ses=7 subj=system_u:system_r:vnc_session_t:s0 msg='op=PAM:session_open grantors=pam_selinux,pam_loginuid,pam_selinux,pam_namespace,pam_keyinit,pam_limits,pam_systemd,pam_unix acct="filbot" exe="/usr/sbin/vncsession" hostname=203.0.113.20 addr=203.0.113.20 terminal=? res=success'
Sep 15 07:42:23 fenix 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" hostname=? addr=? terminal=? res=success'
Sep 15 07:42:23 fenix audit[4312]: AVC avc: denied { search } for pid=4312 comm="vncsession" name=".vnc" dev="dm-3" ino=4616818 scontext=system_u:system_r:vnc_session_t:s0 tcontext=unconfined_u:object_r:user_home_t:s0 tclass=dir permissive=0
Sep 15 07:42:23 fenix audit[4300]: USER_END pid=4300 uid=0 auid=1000 ses=2 subj=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 msg='op=PAM:session_close grantors=pam_keyinit,pam_limits,pam_keyinit,pam_limits,pam_systemd,pam_unix acct="root" exe="/usr/bin/sudo" hostname=? addr=? terminal=/dev/pts/0 res=success'
Sep 15 07:42:23 fenix audit[4300]: CRED_DISP pid=4300 uid=0 auid=1000 ses=2 subj=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 msg='op=PAM:setcred grantors=pam_env,pam_fprintd acct="root" exe="/usr/bin/sudo" hostname=? addr=? terminal=/dev/pts/0 res=success'
Sep 15 07:42:23 fenix audit[4310]: USER_END pid=4310 uid=0 auid=1000 ses=7 subj=system_u:system_r:vnc_session_t:s0 msg='op=PAM:session_close grantors=pam_selinux,pam_loginuid,pam_selinux,pam_namespace,pam_keyinit,pam_limits,pam_systemd,pam_unix acct="filbot" exe="/usr/sbin/vncsession" hostname=203.0.113.20 addr=203.0.113.20 terminal=? res=success'
Sep 15 07:42:23 fenix 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" hostname=? addr=? terminal=? res=success'
Sep 15 07:42:23 fenix systemd[1]: Started Remote desktop service (VNC).
-- Subject: A start job for unit vncserver@:1.service has finished successfully
-- Defined-By: systemd
-- Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- A start job for unit vncserver@:1.service has finished successfully.
--
-- The job identifier is 3476.
Sep 15 07:42:23 fenix vncsession[4310]: vncsession: vncserver exited with status=71
Sep 15 07:42:23 fenix systemd[1]: vncserver@:1.service: Succeeded.
-- Subject: Unit succeeded
-- Defined-By: systemd
-- Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- The unit vncserver@:1.service has successfully entered the 'dead' state.
Sep 15 07:42:23 fenix sudo[4300]: pam_unix(sudo:session): session closed for user root
Sep 15 07:42:23 fenix vncsession[4310]: pam_unix(tigervnc:session): session closed for user filbot
Sep 15 07:42:23 fenix systemd-logind[1923]: Session 7 logged out. Waiting for processes to exit.
Sep 15 07:42:23 fenix systemd[1]: session-7.scope: Succeeded.
-- Subject: Unit succeeded
-- Defined-By: systemd
-- Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- The unit session-7.scope has successfully entered the 'dead' state.
Sep 15 07:42:23 fenix systemd-logind[1923]: Removed session 7.
-- Subject: Session 7 has been terminated
-- Defined-By: systemd
-- Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- Documentation: https://www.freedesktop.org/wiki/Software/systemd/multiseat
--
-- A session with the ID 7 has been terminated.
Sep 15 07:42:25 fenix audit[4360]: USER_ACCT pid=4360 uid=1000 auid=1000 ses=2 subj=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 msg='op=PAM:accounting grantors=pam_unix,pam_localuser acct="filbot" exe="/usr/bin/sudo" hostname=? addr=? terminal=/dev/pts/0 res=success'
Sep 15 07:42:25 fenix audit[4360]: USER_CMD pid=4360 uid=1000 auid=1000 ses=2 subj=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 msg='cwd="/home/filbot" cmd=6A6F75726E616C63746C202D7865202D2D6E6F2D7061676572 exe="/usr/bin/sudo" terminal=pts/0 res=success'
Sep 15 07:42:25 fenix sudo[4360]: filbot : TTY=pts/0 ; PWD=/home/filbot ; USER=root ; COMMAND=/usr/bin/journalctl -xe --no-pager
Sep 15 07:42:25 fenix audit[4360]: CRED_REFR pid=4360 uid=0 auid=1000 ses=2 subj=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 msg='op=PAM:setcred grantors=pam_env,pam_fprintd acct="root" exe="/usr/bin/sudo" hostname=? addr=? terminal=/dev/pts/0 res=success'
Sep 15 07:42:25 fenix sudo[4360]: pam_unix(sudo:session): session opened for user root by filbot(uid=0)
Sep 15 07:42:25 fenix audit[4360]: USER_START pid=4360 uid=0 auid=1000 ses=2 subj=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 msg='op=PAM:session_open grantors=pam_keyinit,pam_limits,pam_keyinit,pam_limits,pam_systemd,pam_unix acct="root" exe="/usr/bin/sudo" hostname=? addr=? terminal=/dev/pts/0 res=success'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment