From unknown Mon Apr 27 20:24:46 2026
X-Loop: owner@bugs.x2go.org
Subject: Bug#1583: user resources not being read
Reply-To: Hanno Foest <hurga-x2go@tigress.com>, 1583@bugs.x2go.org
Resent-From: Hanno Foest <hurga-x2go@tigress.com>
Resent-To: x2go-dev@lists.x2go.org
Resent-CC: X2Go Developers <x2go-dev@lists.x2go.org>
X-Loop: owner@bugs.x2go.org
Resent-Date: Mon, 28 Feb 2022 21:50:02 +0000
Resent-Message-ID: <handler.1583.B.164608478829340@bugs.x2go.org>
Resent-Sender: owner@bugs.x2go.org
X-X2Go-PR-Message: report 1583
X-X2Go-PR-Package: x2goserver-xsession
X-X2Go-PR-Keywords: 
Received: via spool by submit@bugs.x2go.org id=B.164608478829340
          (code B); Mon, 28 Feb 2022 21:50:02 +0000
Received: (at submit) by bugs.x2go.org; 28 Feb 2022 21:46:28 +0000
X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on
	ymir.das-netzwerkteam.de
X-Spam-Level: 
X-Spam-Status: No, score=-0.1 required=3.0 tests=BAYES_40,DKIM_SIGNED,
	DKIM_VALID,DKIM_VALID_AU,SPF_HELO_PASS,T_SCC_BODY_TEXT_LINE,
	URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2
Received: from tigress.com (tigress.com [85.199.154.53])
	by ymir.das-netzwerkteam.de (Postfix) with ESMTPS id F3B4D5DA93
	for <submit@bugs.x2go.org>; Mon, 28 Feb 2022 22:46:14 +0100 (CET)
Received: by tigress.com (Postfix, from userid 593)
	id F31B714008E; Mon, 28 Feb 2022 22:46:13 +0100 (CET)
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=tigress.com; s=dkim;
	t=1646084773; bh=cpAfJAw/KnnjPJOaJlG6+bdHSTpDnd6VhfyueAHspro=;
	h=Date:From:To:Subject:From;
	b=TuJVDU61TWBSOhPcGm+FAAt3ktkFgIGDiU0CSphtOrx4QkT57xssZ0c0oSM4GWAKL
	 SRJeB02HMIyAn4PXtyHrUqxoHqjg9cyMZ9yACraFHHR2aH544I0gq0MNhjDO6ZFl/c
	 O4RiqF0Nj70YldgUsMMbwQ6mxrnExJBKKRzQ70FA=
Date: Mon, 28 Feb 2022 22:46:13 +0100
From: Hanno Foest <hurga-x2go@tigress.com>
To: submit@bugs.x2go.org
Message-ID: <20220228214613.GJ2792@tigress.com>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="fuPmfhaMCYsUfEBC"
Content-Disposition: inline
X-message-flag: Please send plain text messages only. Thank you.
User-Agent: Mutt/1.5.24 (2015-08-30)


--fuPmfhaMCYsUfEBC
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

Package: x2goserver-xsession
Version: 4.1.0.4-0x2go1.2~git20220217.1940+11.heuler.1

I noticed that the user resources (ie, $HOME/.Xresources-x2go) are not
being read on my new Devuan Chimaera instance (should be the same for
Debian stable).

xsession-x2go-errors told me that "has_option" command was not found:

grep has_option .xsession-x2go-gui3-errors
/etc/x2go/Xsession.d/30x11-common_xresources: Zeile 16: has_option:
Kommando nicht gefunden.

Upon investigation, it looks like this command, and reading of the
option file Xsession.options, used to be defined in
/etc/X11/Xsession.d/20x11-common_process-args, but now resides in
/etc/X11/Xsession. /etc/x2go/Xsession is a modified copy of
/etc/X11/Xsession, but this change was not made.

Copying the relevant lines over from /etc/X11/Xsession made things work
again. Patch attached (please bear with me - I'm a sysadmin, not a
developer).

Hanno

--fuPmfhaMCYsUfEBC
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="x2gouserresources.txt"

diff -u /etc/x2go/Xsession.orig /etc/x2go/Xsession
--- /etc/x2go/Xsession.orig     2022-02-17 22:09:39.000000000 +0100
+++ /etc/x2go/Xsession  2022-02-20 00:46:48.847537872 +0100
@@ -77,6 +77,24 @@
 ALTUSERXSESSION=$HOME/.Xsession-x2go
 ERRFILE="${HOME}/.xsession-x2go-${cur_hostname}-errors"
 
+OPTIONS="$(
+  if [ -r "$OPTIONFILE" ]; then
+    cat "$OPTIONFILE"
+  fi
+  if [ -d /etc/X11/Xsession.options.d ]; then
+    run-parts --list --regex '\.conf$' /etc/X11/Xsession.options.d | xargs -d '\n' cat
+  fi
+)"
+
+has_option() {
+  # Ensure that a later no-foo overrides an earlier foo
+  if [ "$(echo "$OPTIONS" | grep -Eo "^(no-)?$1\>" | tail -n 1)" = "$1" ]; then
+    return 0
+  else
+    return 1
+  fi
+}
+
 # Move the old error log file away.
 if [ -f "${ERRFILE}" ]; then
        if [ -L "${ERRFILE}" ]; then


--fuPmfhaMCYsUfEBC--
