public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Sam James" <sam@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/gentoo:master commit in: net-misc/tigervnc/, net-misc/tigervnc/files/
Date: Tue, 22 Mar 2022 18:01:23 +0000 (UTC)	[thread overview]
Message-ID: <1647972071.f94f6f15314c9a4b161efacb57042744346bc234.sam@gentoo> (raw)

commit:     f94f6f15314c9a4b161efacb57042744346bc234
Author:     Viorel Munteanu <ceamac.paragon <AT> gmail <DOT> com>
AuthorDate: Tue Mar 22 07:27:03 2022 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Tue Mar 22 18:01:11 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f94f6f15

net-misc/tigervnc: Fix the init script

Remove $VNC_OPTS from conf.d
Make init script POSIX compliant

Closes: https://bugs.gentoo.org/835730
Closes: https://bugs.gentoo.org/506522
Signed-off-by: Viorel Munteanu <ceamac.paragon <AT> gmail.com>
Closes: https://github.com/gentoo/gentoo/pull/24703
Signed-off-by: Sam James <sam <AT> gentoo.org>

 net-misc/tigervnc/files/tigervnc-1.12.0.confd      |  4 ++--
 net-misc/tigervnc/files/tigervnc-1.12.0.initd      | 28 ++++++++++------------
 ...-1.12.0-r2.ebuild => tigervnc-1.12.0-r3.ebuild} |  0
 3 files changed, 14 insertions(+), 18 deletions(-)

diff --git a/net-misc/tigervnc/files/tigervnc-1.12.0.confd b/net-misc/tigervnc/files/tigervnc-1.12.0.confd
index a65c991eabcc..d03da01660be 100644
--- a/net-misc/tigervnc/files/tigervnc-1.12.0.confd
+++ b/net-misc/tigervnc/files/tigervnc-1.12.0.confd
@@ -11,5 +11,5 @@
 # TIGERVNC_XSESSION_FILE="/etc/lightdm/Xsession"
 # TIGERVNC_XSESSION_FILE="/usr/share/slim/Xsession"
 
-# Specify any of vncserver(1) and Xvnc(1) options. See the respective man pages for more information.
-# VNC_OPTS=""
+# 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.12.0.initd b/net-misc/tigervnc/files/tigervnc-1.12.0.initd
index 59da61eed5f7..c27d9c01bd7e 100644
--- a/net-misc/tigervnc/files/tigervnc-1.12.0.initd
+++ b/net-misc/tigervnc/files/tigervnc-1.12.0.initd
@@ -2,25 +2,26 @@
 # Copyright 1999-2022 Gentoo Authors
 # Distributed under the terms of the GNU General Public License, v2 or later
 
+# shellcheck shell=sh
+
 depend() {
 	need net
 }
 
 checkconfig() {
 	if [ -n "${DISPLAYS}" ]; then
-		if [ $1 = "start" ]; then
-			local user
+		if [ "$1" = "start" ]; then
 			for user in $DISPLAYS; do
 				if eval [ ! -f "~${user%%:*}/.vnc/passwd" ]; then
 					eerror "There are no passwords defined for user ${user%%:*}."
 					return 1
 				elif [ -e "/tmp/.X11-unix/X${user##*:}" ]; then
 					eerror "Display :${user##*:} appears to be already in use because of /tmp/.X11-unix/X${user##*:}"
-					eerror "Remove this file if there is no X server $HOSTNAME:${user##*:}"
+					eerror "Remove this file if there is no X server for :${user##*:}"
 					return 1
 				elif [ -e "/tmp/.X${user##*:}-lock" ]; then
 					eerror "Display :${user##*:} appears to be already in use because of /tmp/.X${user##*:}-lock"
-					eerror "Remove this file if there is no X server $HOSTNAME:${user##*:}"
+					eerror "Remove this file if there is no X server for :${user##*:}"
 					return 1
 				elif ! grep -E "^[^#]*:${user##*:}=${user%%:*}" /etc/tigervnc/vncserver.users > /dev/null 2>&1; then
 					eerror "User ${user%%:*} is not defined for display :${user##*:} in /etc/tigervnc/vncserver.users"
@@ -30,6 +31,8 @@ checkconfig() {
 		fi
 		return 0
 	else
+		# here it is intended for $DISPLAYS to not expand
+		# shellcheck disable=SC2016
 		eerror 'Please define $DISPLAYS in /etc/conf.d/tigervnc'
 		return 1
 	fi
@@ -39,15 +42,8 @@ start() {
 	checkconfig start || return 1
 	ebegin "Starting TigerVNC server"
 	for user in $DISPLAYS; do
-		usrname=${user%%:*}
-		usropts=VNC_OPTS_${usrname}
-		usrdisp=${user##*:}
-		usrvar=$usropts"["$usrdisp"]"
-		[ -z ${!usrvar} ] && vnc_opts=$VNC_OPTS || vnc_opts=${!usrvar}
-
 		[ -n "${TIGERVNC_XSESSION_FILE}" ] && export TIGERVNC_XSESSION_FILE
-
-		/usr/libexec/vncsession-start :${user##*:} $vnc_opts &>/dev/null
+		/usr/libexec/vncsession-start ":${user##*:}" >/dev/null 2>&1
 	done
 	eend $?
 }
@@ -59,10 +55,10 @@ stop() {
 		# vncserver no longer provides a `-kill` option
 		# killing vncsession does not work, we have to kill Xvnc
 		# run pstree to see exactly what's going on
-		sessionpid=`cat /run/vncsession-\:${user##*:}.pid`
-		serverpid=`pstree -p $sessionpid | grep Xvnc | sed -e 's/^.*Xvnc(//
-			s/).*$//'`
-		kill $serverpid &>/dev/null
+		sessionpid=$(cat /run/vncsession-:"${user##*:}".pid)
+		serverpid=$(pstree -p "$sessionpid" | grep Xvnc | sed -e 's/^.*Xvnc(//
+			s/).*$//')
+		kill "$serverpid" >/dev/null 2>&1
 	done
 	# Do not fail if a server is missing
 	/bin/true

diff --git a/net-misc/tigervnc/tigervnc-1.12.0-r2.ebuild b/net-misc/tigervnc/tigervnc-1.12.0-r3.ebuild
similarity index 100%
rename from net-misc/tigervnc/tigervnc-1.12.0-r2.ebuild
rename to net-misc/tigervnc/tigervnc-1.12.0-r3.ebuild


             reply	other threads:[~2022-03-22 18:01 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-22 18:01 Sam James [this message]
  -- strict thread matches above, loose matches on Subject: below --
2024-09-01 10:56 [gentoo-commits] repo/gentoo:master commit in: net-misc/tigervnc/, net-misc/tigervnc/files/ Viorel Munteanu
2024-07-27 19:36 Viorel Munteanu
2024-06-22  7:57 Viorel Munteanu
2023-08-03  6:00 Viorel Munteanu
2023-06-24  9:08 Viorel Munteanu
2023-05-03 17:06 Viorel Munteanu
2023-03-31  7:03 Viorel Munteanu
2022-05-13 20:04 Sam James
2021-12-07 23:45 Sam James
2021-09-17  2:34 Sam James
2018-12-15 19:10 Matt Turner
2018-07-23  8:46 Tony Vroon
2017-11-27 15:56 Alice Ferrazzi
2017-03-02 11:12 Michael Palimaka
2017-01-26 10:26 Michael Palimaka
2017-01-25 18:05 Matt Turner
2016-01-29 15:55 Michał Górny
2016-01-09 11:44 Jeroen Roovers

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=1647972071.f94f6f15314c9a4b161efacb57042744346bc234.sam@gentoo \
    --to=sam@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.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