[Bug 1955135] Re: multiple issues with /etc/X11/Xsession.d/ - "has_option: command not found"
Boris Steiner
1955135 at bugs.launchpad.net
Thu Sep 1 22:01:26 UTC 2022
*** This bug is a duplicate of bug 1922414 ***
https://bugs.launchpad.net/bugs/1922414
This issue is caused by lightdm running /usr/sbin/lightdm-session
instead of /etc/X11/Xsession.
The simplest workaround for me was:
- introduce has_option functon as 1st step in Xsession.d sourced scripts
- as root create file /etc/X11/Xsession.d/01custom-has-option with following content:
#check if has_option is already defined; if not, define
has_option 2>1 > /dev/null || 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
}
- logout and login
Details:
- /etc/X11/Xsession introduces has_option shell function that check if Xsession.options contains predefined option
- /etc/X11/Xsession sources all files under /etc/X11/Xsession.d in alphabetic order
- as the scripts are sourced they maintain the same environemnt and definitions of variables or functions as Xsession
- however, lightdm uses lightdm-session that also sources /etc/X11/Xsession.d/* BUT does NOT define has_option function
- provided script checks if the function has_option already exists (Xsession is in play) and if not (lightdm-session's game) it defines it the same way as is in /etc/X11/Xsession
Alternative solutions:
- modify lightdm-session to contain has_option the same way as /etc/X11/Xsession
- modify (create) /etc/lightdm/lightdm.conf containing:
[Seat:*]
session-wrapper=/etc/X11/Xsession
- requires reboot; it did not work ok for 100% as my .profile env vars
were not correctly propagated
--
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to dbus in Ubuntu.
https://bugs.launchpad.net/bugs/1955135
Title:
multiple issues with /etc/X11/Xsession.d/ - "has_option: command not
found"
Status in dbus package in Ubuntu:
Confirmed
Status in xorg package in Ubuntu:
Confirmed
Bug description:
Steps to reproduce:
1. Boot 20211217 Ubuntu MATE daily ISO
2. Open ~/.xsession-errors
Expected results:
* no errors and warnings
Actual results:
* there are two errors about xorg:
/etc/X11/Xsession.d/30x11-common_xresources: line 16: has_option: command not found
/etc/X11/Xsession.d/90x11-common_ssh-agent: line 9: has_option: command not found
ProblemType: Bug
DistroRelease: Ubuntu 22.04
Package: x11-common 1:7.7+23ubuntu1
ProcVersionSignature: Ubuntu 5.13.0-19.19-generic 5.13.14
Uname: Linux 5.13.0-19-generic x86_64
NonfreeKernelModules: zfs zunicode zavl icp zcommon znvpair
ApportVersion: 2.20.11-0ubuntu74
Architecture: amd64
BootLog: Error: [Errno 13] Permission denied: '/var/log/boot.log'
CasperMD5CheckResult: pass
CasperVersion: 1.465
CompositorRunning: None
CurrentDesktop: MATE
Date: Fri Dec 17 14:22:15 2021
Dependencies: lsb-base 11.1.0ubuntu3
DistUpgraded: Fresh install
DistroCodename: jammy
DistroVariant: ubuntu
ExtraDebuggingInterest: Yes, if not too technical
GraphicsCard:
NVIDIA Corporation GF108M [GeForce GT 425M] [10de:0df0] (rev a1) (prog-if 00 [VGA controller])
Subsystem: Sony Corporation GF108M [GeForce GT 425M] [104d:907a]
LiveMediaBuild: Ubuntu-MATE 22.04 LTS "Jammy Jellyfish" - Alpha amd64 (20211217)
MachineType: Sony Corporation VPCF13Z1R
PackageArchitecture: all
ProcEnviron:
TERM=xterm-256color
PATH=(custom, no user)
XDG_RUNTIME_DIR=<set>
LANG=en_US.UTF-8
SHELL=/bin/bash
ProcKernelCmdLine: BOOT_IMAGE=/casper/vmlinuz file=/cdrom/preseed/username.seed maybe-ubiquity quiet splash ---
SourcePackage: xorg
UpgradeStatus: No upgrade log present (probably fresh install)
dmi.bios.date: 10/20/2010
dmi.bios.release: 1.90
dmi.bios.vendor: American Megatrends Inc.
dmi.bios.version: R0190Y9
dmi.board.asset.tag: N/A
dmi.board.name: VAIO
dmi.board.vendor: Sony Corporation
dmi.board.version: N/A
dmi.chassis.asset.tag: N/A
dmi.chassis.type: 10
dmi.chassis.vendor: Sony Corporation
dmi.chassis.version: N/A
dmi.ec.firmware.release: 1.90
dmi.modalias: dmi:bvnAmericanMegatrendsInc.:bvrR0190Y9:bd10/20/2010:br1.90:efr1.90:svnSonyCorporation:pnVPCF13Z1R:pvrC606GZYK:skuN/A:rvnSonyCorporation:rnVAIO:rvrN/A:cvnSonyCorporation:ct10:cvrN/A:
dmi.product.family: VAIO
dmi.product.name: VPCF13Z1R
dmi.product.sku: N/A
dmi.product.version: C606GZYK
dmi.sys.vendor: Sony Corporation
version.compiz: compiz N/A
version.libdrm2: libdrm2 2.4.107-8ubuntu1
version.libgl1-mesa-dri: libgl1-mesa-dri 21.2.2-1ubuntu1
version.libgl1-mesa-glx: libgl1-mesa-glx N/A
version.xserver-xorg-core: xserver-xorg-core 2:1.20.13-1ubuntu1
version.xserver-xorg-input-evdev: xserver-xorg-input-evdev N/A
version.xserver-xorg-video-ati: xserver-xorg-video-ati 1:19.1.0-2build1
version.xserver-xorg-video-intel: xserver-xorg-video-intel 2:2.99.917+git20200714-1ubuntu2
version.xserver-xorg-video-nouveau: xserver-xorg-video-nouveau 1:1.0.17-1build1
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/dbus/+bug/1955135/+subscriptions
More information about the foundations-bugs
mailing list