Github messages for voidlinux
 help / color / mirror / Atom feed
From: ahesford <ahesford@users.noreply.github.com>
To: ml@inbox.vuxu.org
Subject: Re: [ISSUE] [CLOSED] tigervnc: a working runit service for the tigervnc vncserver cannot be written
Date: Wed, 04 Oct 2023 00:57:07 +0200	[thread overview]
Message-ID: <20231003225707.-T02Ime9JMc2KWCOCa4mixd8iYKDKWjcggyZBExk6a8@z> (raw)
In-Reply-To: <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-45522@inbox.vuxu.org>

[-- Attachment #1: Type: text/plain, Size: 5095 bytes --]

Closed issue by zmudc on void-packages repository

https://github.com/void-linux/void-packages/issues/45522

Description:
### Is this a new report?

Yes

### System Info

Void 6.3.13_1 x86_64-musl GenuineIntel/VM notuptodate rFFF (I am not sure why this is reporting notuptodate)

### Package(s) Affected

tigervnc-1.12.0_1

### Does a report exist for this bug with the project's home (upstream) and/or another distro?

https://github.com/TigerVNC/tigervnc/issues/1649
https://github.com/TigerVNC/tigervnc/pull/1651

### Expected behaviour

The package is supposed to be able to configure a vncserver service on Xvnc displays configured in /etc/tigervnc/vncserver.users on an ordinarily configured Void installation. It is expected that the service will start and run correctly after enabling it, allowing the user or users configured in /etc/tigervnc/vncserver.users to connect to the tigervnc server for a remote session.

### Actual behaviour

The service starts and stops immediately in an endless loop (every second I think) unless the down file is added to the service directory. And even with the down file, the service will not start with the 'sv once vncserver' command (assuming the runit service directory is named vncserver) but instead exits without successfully starting. Details of the causes of these problems follow...

The first error in the log (presuming sockog is configured according to the handbook) is:

2023-08-10T14:30:22.21984 auth.crit: Aug 10 14:30:22 vncsession[1311]: pam_open_session failed: 28 (Module is unknown)

This error appears in the /var/log/socklog/secure/current logfile with the default socklog configuration.

After fixing the PAM configuration, the service still fails with a different error, also in the /var/log/socklog/secure/current logfile:

2023-08-10T14:50:30.43823 auth.warn: Aug 10 14:50:30 vncsession[2384]: vncsession: vncserver exited with status=2

This error is caused by the fact that upstream expects an Xsession wrapper script to be at /etc/X11/xinit/Xsession or /etc/X11/Xsession but a typical Void installation lacks those files. Other major distros such as Debian and Fedora have such files, but not Void.

This can be fixed by patching the vncserver perl script provided by upstream so it can find an appropriate Xsession wrapper script on Void.

After fixing the Xsession wrapper script, there is the third problem: The vncsession binary provided by upstream forks, detaches, and runs in the background without providing an option (not even a debug option) to run in the foreground, and this is totally incompatible with Void's runit system. This is also the cause of the endless loop of stop and start without having the down file in the service directory. This can be fixed by patching the vncession.c file in the upstream source so it runs in the foreground. That is what the above mentioned pull request to the upstream project does, but so far the upstream project has not responded in any way to the PR.

A PR has also been submitted to void-packages to fix all these issues and update the package to version 1.13.1:

https://github.com/void-linux/void-packages/pull/45307

### Steps to reproduce

1. Install the XFCE desktop from the live image (I used the x86_64-musl version). I also did not do a network install to get the installation to have the XFCE desktop installed.
2. Update the system (i.e.: sudo xbps-install -Su)
3. Configure ordinary logging according to the handbook with socklog
4. Install the tigervnc package: sudo xbps-install tigervnc
5. Configure it according to the man pages (start with man vncsession): This requires at least mapping a user to display :1 in /etc/tigervnc/vncserver.users and also the other configuration files should be tweaked to set the session=xfce and the geometry to whatever your vnc viewer will support. Also, keep security settings in mind and listen only on localhost if you are not on a trusted network. Note that vncpasswd for some reason does not display a prompt to set a vncpasswd but it still works - you need to enter the password and hit enter, enter the password again and then it will ask if you want to enter a read-only password. And the password is changed successfully even without the prompt by vncpasswd.
6. Write an appropriate runit service according to the handbook. Hint: because the vncsession binary forks, detaches, and runs in the background, the run script needs to use fghack from the daemontools package (an ugly hack) unless the patch mentioned in https://github.com/TigerVNC/tigervnc/pull/1651 is applied. If the vncsession.c file is patched so vncsession runs in the foreground, the main command needed in the run script is something like:
exec /usr/libexec/vncsession-start "${DISPLAY:-:1}"
Otherwise, you will need to use the ugly hack using fghack provided by the daemontools package:
exec fghack /usr/libexec/vncsession-start "${DISPLAY:-:1}"
8. Observe the service does not start unless the fixes mentioned in https://github.com/void-linux/void-packages/pull/45307 are applied.

  parent reply	other threads:[~2023-10-03 22:57 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-10 15:44 [ISSUE] tigervnc: multiple patches needed to create a working runit service for the tigervnc vncserver zmudc
2023-08-17 21:32 ` tigervnc: a working runit service for the tigervnc vncserver cannot be written zmudc
2023-08-17 21:44 ` ahesford
2023-08-17 21:51 ` zmudc
2023-10-03 22:57 ` ahesford
2023-10-03 22:57 ` ahesford [this message]
2023-10-04  0:08 ` ahesford
2023-10-04 13:36 ` zmudc
2023-10-04 13:55 ` ahesford

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20231003225707.-T02Ime9JMc2KWCOCa4mixd8iYKDKWjcggyZBExk6a8@z \
    --to=ahesford@users.noreply.github.com \
    --cc=ml@inbox.vuxu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).