From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 4428C158009 for ; Sat, 24 Jun 2023 09:08:43 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 7B70BE0841; Sat, 24 Jun 2023 09:08:42 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id F00D1E0841 for ; Sat, 24 Jun 2023 09:08:40 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id D3136335D55 for ; Sat, 24 Jun 2023 09:08:39 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 3E4A4A95 for ; Sat, 24 Jun 2023 09:08:38 +0000 (UTC) From: "Viorel Munteanu" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Viorel Munteanu" Message-ID: <1687597357.8c9e7c2263068ab5d074c7652431e7952ccf7eba.ceamac@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: net-misc/tigervnc/, net-misc/tigervnc/files/ X-VCS-Repository: repo/gentoo X-VCS-Files: net-misc/tigervnc/files/tigervnc-1.13.1.confd net-misc/tigervnc/files/tigervnc-1.13.1.initd net-misc/tigervnc/tigervnc-1.13.1-r3.ebuild net-misc/tigervnc/tigervnc-9999.ebuild X-VCS-Directories: net-misc/tigervnc/ net-misc/tigervnc/files/ X-VCS-Committer: ceamac X-VCS-Committer-Name: Viorel Munteanu X-VCS-Revision: 8c9e7c2263068ab5d074c7652431e7952ccf7eba X-VCS-Branch: master Date: Sat, 24 Jun 2023 09:08:38 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 73ec5e51-0242-48bf-bc56-8d0865049f8d X-Archives-Hash: 8071529407221473c2e08c31d1a5131b commit: 8c9e7c2263068ab5d074c7652431e7952ccf7eba Author: Viorel Munteanu gentoo org> AuthorDate: Fri Jun 2 17:09:34 2023 +0000 Commit: Viorel Munteanu gentoo org> CommitDate: Sat Jun 24 09:02:37 2023 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8c9e7c22 net-misc/tigervnc: one service per display Change configuration for openrc users. Currently, it has 3 drawbacks: - the sessions must be defined in 2 places - if a display crashes, it cannot be restarted without stopping all of them - openrc only keeps track of the last display started, so if any other display crashes, it will not show as crashed. The first issue is solved by no longer using DISPLAYS fron conf.d, and parsing /etc/tigervnc/vncserver.users directly. The other two by switching to a one service per display model. Closes: https://github.com/gentoo/gentoo/pull/31277 Signed-off-by: Viorel Munteanu gentoo.org> net-misc/tigervnc/files/tigervnc-1.13.1.confd | 13 ++++ net-misc/tigervnc/files/tigervnc-1.13.1.initd | 88 ++++++++++++++++++++++ ...ervnc-9999.ebuild => tigervnc-1.13.1-r3.ebuild} | 14 ++-- net-misc/tigervnc/tigervnc-9999.ebuild | 11 ++- 4 files changed, 114 insertions(+), 12 deletions(-) diff --git a/net-misc/tigervnc/files/tigervnc-1.13.1.confd b/net-misc/tigervnc/files/tigervnc-1.13.1.confd new file mode 100644 index 000000000000..bb6dae7df032 --- /dev/null +++ b/net-misc/tigervnc/files/tigervnc-1.13.1.confd @@ -0,0 +1,13 @@ +# Config file for /etc/init.d/tigervnc + +# Add the user(s) Xvnc(1) should be run for to /etc/tigervnc/vncserver.users +# DISPLAYS is no loger used. + +# Optionally override the default Xsession file +# TIGERVNC_XSESSION_FILE="/usr/share/sddm/scripts/Xsession" +# TIGERVNC_XSESSION_FILE="/etc/gdm/Xsession" +# TIGERVNC_XSESSION_FILE="/etc/lightdm/Xsession" +# TIGERVNC_XSESSION_FILE="/usr/share/slim/Xsession" + +# vncsession no longer supports VNC_OPTS +# Use /etc/tigervnc/vncserver-config-defaults or $HOME/.vnc/config instead diff --git a/net-misc/tigervnc/files/tigervnc-1.13.1.initd b/net-misc/tigervnc/files/tigervnc-1.13.1.initd new file mode 100644 index 000000000000..f7e72fa84c07 --- /dev/null +++ b/net-misc/tigervnc/files/tigervnc-1.13.1.initd @@ -0,0 +1,88 @@ +#!/sbin/openrc-run +# Copyright 1999-2022 Gentoo Authors +# Distributed under the terms of the GNU General Public License, v2 or later + +# shellcheck shell=sh + +# Create symlinks for all displays. +# For example for display :1, run `ln -s tigervnc /etc/init.d/tigervnc.1` +# Then `rc-update add tigervnc.1 default` +# For compatibility, /etc/init.d/tigervnc will start all displays. + +DISPLAYS=${SVCNAME#*.} +if [ "$DISPLAYS" = "tigervnc" ]; then + should_warn=1 + DISPLAYS=$(grep -v "^#" /etc/tigervnc/vncserver.users | sed -e 's/=.*//' -e 's/^://') +fi + +depend() { + need net +} + +checkconfig() { + if [ -n "${DISPLAYS}" ]; then + if [ "$1" = "start" ]; then + for display in $DISPLAYS; do + user="$(grep "^:${display}" /etc/tigervnc/vncserver.users)" + user=${user#*=} + # bug #690046 + if [ -z "${user}" ]; then + eerror "User is not defined for display :${display} in /etc/tigervnc/vncserver.users" + return 1 + elif ! runuser -l "${user}" -c "[ -f ~/.vnc/passwd ]"; then + eerror "There are no passwords defined for user ${user}." + return 1 + elif [ -e "/tmp/.X11-unix/X${display}" ]; then + eerror "Display :${display} appears to be already in use because of /tmp/.X11-unix/X${display}" + eerror "Remove this file if there is no X server for :${display}" + return 1 + elif [ -e "/tmp/.X${display}-lock" ]; then + eerror "Display :${display} appears to be already in use because of /tmp/.X${display}-lock" + eerror "Remove this file if there is no X server for :${display}" + return 1 + fi + FREEDISPLAYS="${FREEDISPLAYS} ${display}" + done + fi + return 0 + else + eerror 'There are no displays configured in /etc/tigervnc/vncserver.users' + return 1 + fi +} + +checkwarn() { + if [ "${should_warn}" = "1" ]; then + ewarn 'Running /etc/init.d/tigervnc in compatibility mode' + ewarn 'Please migrate to one service per display as detailed here:' + ewarn 'https://wiki.gentoo.org/wiki/TigerVNC#Migrating_from_1.13.1-r2_or_lower:' + fi +} + +start() { + checkwarn + FREEDISPLAYS="" + checkconfig start || return 1 + for display in $FREEDISPLAYS; do + [ -n "${TIGERVNC_XSESSION_FILE}" ] && export TIGERVNC_XSESSION_FILE + ebegin "Starting TigerVNC server :${display}" + start-stop-daemon --start --pidfile=/run/vncsession-":${display}".pid /usr/libexec/vncsession-start -- ":${display}" + eend $? + done +} + +stop() { + checkconfig stop || return 2 + for display in $DISPLAYS; do + ebegin "Stopping TigerVNC server :${display}" + start-stop-daemon --stop --pidfile=/run/vncsession-":${display}".pid + eend $? + done + # Do not fail if a server is missing + /bin/true +} + +restart() { + svc_stop + svc_start +} diff --git a/net-misc/tigervnc/tigervnc-9999.ebuild b/net-misc/tigervnc/tigervnc-1.13.1-r3.ebuild similarity index 94% copy from net-misc/tigervnc/tigervnc-9999.ebuild copy to net-misc/tigervnc/tigervnc-1.13.1-r3.ebuild index a1d75fef3750..14114aae2041 100644 --- a/net-misc/tigervnc/tigervnc-9999.ebuild +++ b/net-misc/tigervnc/tigervnc-1.13.1-r3.ebuild @@ -72,10 +72,7 @@ COMMON_DEPEND=" " RDEPEND="${COMMON_DEPEND} java? ( >=virtual/jre-1.8:* ) - server? ( - dev-lang/perl - sys-process/psmisc - ) + server? ( dev-lang/perl ) " DEPEND="${COMMON_DEPEND} java? ( >=virtual/jdk-1.8:* ) @@ -203,8 +200,8 @@ src_install() { emake -C unix/xserver/hw/vnc DESTDIR="${D}" install rm -v "${ED}"/usr/$(get_libdir)/xorg/modules/extensions/libvnc.la || die - newconfd "${FILESDIR}"/${PN}-1.12.0.confd ${PN} - newinitd "${FILESDIR}"/${PN}-1.12.0.initd ${PN} + newconfd "${FILESDIR}"/${PN}-1.13.1.confd ${PN} + newinitd "${FILESDIR}"/${PN}-1.13.1.initd ${PN} systemd_douserunit unix/vncserver/vncserver@.service @@ -220,6 +217,11 @@ src_install() { pkg_postinst() { xdg_pkg_postinst + use server && { + elog 'OpenRC users: please migrate to one service per display as documented here:' + elog 'https://wiki.gentoo.org/wiki/TigerVNC#Migrating_from_1.13.1-r2_or_lower:' + } + local OPTIONAL_DM="gnome-base/gdm x11-misc/lightdm x11-misc/sddm x11-misc/slim" use server && \ optfeature "keeping track of the xorg-server module" net-misc/tigervnc-xorg-module && \ diff --git a/net-misc/tigervnc/tigervnc-9999.ebuild b/net-misc/tigervnc/tigervnc-9999.ebuild index a1d75fef3750..23b38081e296 100644 --- a/net-misc/tigervnc/tigervnc-9999.ebuild +++ b/net-misc/tigervnc/tigervnc-9999.ebuild @@ -72,10 +72,7 @@ COMMON_DEPEND=" " RDEPEND="${COMMON_DEPEND} java? ( >=virtual/jre-1.8:* ) - server? ( - dev-lang/perl - sys-process/psmisc - ) + server? ( dev-lang/perl ) " DEPEND="${COMMON_DEPEND} java? ( >=virtual/jdk-1.8:* ) @@ -203,8 +200,8 @@ src_install() { emake -C unix/xserver/hw/vnc DESTDIR="${D}" install rm -v "${ED}"/usr/$(get_libdir)/xorg/modules/extensions/libvnc.la || die - newconfd "${FILESDIR}"/${PN}-1.12.0.confd ${PN} - newinitd "${FILESDIR}"/${PN}-1.12.0.initd ${PN} + newconfd "${FILESDIR}"/${PN}-1.13.1.confd ${PN} + newinitd "${FILESDIR}"/${PN}-1.13.1.initd ${PN} systemd_douserunit unix/vncserver/vncserver@.service @@ -220,6 +217,8 @@ src_install() { pkg_postinst() { xdg_pkg_postinst + use server && elog 'OpenRC users: please migrate to one service per display as documented here' #FIXME: add link + local OPTIONAL_DM="gnome-base/gdm x11-misc/lightdm x11-misc/sddm x11-misc/slim" use server && \ optfeature "keeping track of the xorg-server module" net-misc/tigervnc-xorg-module && \