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 1790443

Summary: tigervnc service via unit file improvements
Product: Red Hat Enterprise Linux 8 Reporter: Jan Grulich <jgrulich>
Component: tigervncAssignee: Jan Grulich <jgrulich>
Status: CLOSED ERRATA QA Contact: Desktop QE <desktop-qa-list>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 8.3CC: desktop-qa-list, jbastian, mkrajnak, tpelka
Target Milestone: rcFlags: pm-rhel: mirror+
Target Release: 8.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: tigervnc-1.10.1-1.el8 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: 1775153 Environment:
Last Closed: 2020-11-04 03:00:07 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1775153    
Bug Blocks:    

Comment 6 Martin Krajnak 2020-05-13 12:51:12 UTC
From the information provided by jgrulich, I gathered this reproducer for the verification:

Some important notes:
1) You cannot start a service for a user who is currently logged in
(graphically)

2) Make sure you remove old service files which previously had to be copied to
/etc/systemd/system as these will be loaded first and it will obviously fail.
The new service file is in /usr/lib/systemd/system.

Setup:
1)
$ sudo semodule -i /usr/share/selinux/packages/vncsession.pp
$ sudo restorecon /usr/sbin/vncsession /usr/libexec/vncsession-start

2) Add displays and usernames to /etc/tigervnc/vncserver.users
# echo ":22=test" >> /etc/tigervnc/vncserver.users
# cat /etc/tigervnc/vncserver.users
....
:11=test
:22=test2

3) Set desktop for GNOME
# echo "session=gnome" >> /etc/tigervnc/vncserver-config-defaults

4) start the vnc server for user test2
$ sudo systemctl daemon-reload 
$ sudo systemctl start vncserver@:22

5) Verify the service is running
$ sudo systemctl status vncserver@:22

Then was able to connect via vncviewer. I tested the lockscreen and it worked for me. 
Logging out via gnome-shell terminates the vncservice.

Hopefully I did not miss anything.

Comment 7 Jeff Bastian 2020-06-25 19:38:40 UTC
The new HOWTO doc is in the wrong directory:

~]# rpm -q tigervnc-server
tigervnc-server-1.10.1-4.el8.aarch64

~]# rpm -ql tigervnc-server | grep HOWTO
/usr/share/doc/HOWTO.md


I think it should be in /usr/share/doc/tigervnc/HOWTO.md

Comment 8 Jeff Bastian 2020-06-25 19:42:40 UTC
Also, removing the /usr/bin/vncserver command is rather jarring to users (it was to me, at least!).  Maybe you can create a new /usr/bin/vncserver script which points users to the new HOWTO doc?  Something like this:

~]$ cat /usr/bin/vncserver
#!/bin/bash
echo "vncserver has been replaced by a systemd unit."
echo "Please read /usr/share/doc/tigervnc/HOWTO.md for more info."

Comment 9 Jan Grulich 2020-06-25 19:50:18 UTC
(In reply to Jeff Bastian from comment #8)
> Also, removing the /usr/bin/vncserver command is rather jarring to users (it
> was to me, at least!).  Maybe you can create a new /usr/bin/vncserver script
> which points users to the new HOWTO doc?  Something like this:
> 
> ~]$ cat /usr/bin/vncserver
> #!/bin/bash
> echo "vncserver has been replaced by a systemd unit."
> echo "Please read /usr/share/doc/tigervnc/HOWTO.md for more info."

That's quite a good idea. I will add something like that and fix installation of the HOWTO.md file.

Comment 11 Jan Grulich 2020-06-29 13:54:02 UTC
There is now a new build of tigervnc, which:
1) Fixes installation of the HOWTO.md file
2) Installs /usr/bin/vncserver script which will tell the user to read the HOWTO.md file

Comment 12 Jeff Bastian 2020-06-29 14:47:23 UTC
The new build looks good.  Thanks!

[root@ci-vm-10-0-137-119 ~]# rpm -q tigervnc-server
tigervnc-server-1.10.1-5.el8.x86_64

[root@ci-vm-10-0-137-119 ~]# rpm -ql tigervnc-server | grep -e HOWTO -e bin/vncserver
/usr/bin/vncserver
/usr/share/doc/tigervnc/HOWTO.md

[root@ci-vm-10-0-137-119 ~]# vncserver
vncserver has been replaced by a systemd unit.
Please read /usr/share/doc/tigervnc/HOWTO.md for more information.

Comment 15 errata-xmlrpc 2020-11-04 03:00:07 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (tigervnc bug fix and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2020:4683