Public bug reported:

The bash variable SHLVL is 2, rather than 1, in the outermost shell
process in terminal emulators (gnome-terminal, xterm, etc. -- it doesn't
matter).  This makes SHLVL useless, and breaks many scripts (run from
.bashrc etc.) which look for SHLVL=1 to save/restore state of some kind.

This is a painful REGRESSION since 16.04.

SHLVL=1 in pty terminals (Ctrl-Alt-F1 etc.) so the problem is not in
bash.

The parent of the "outer most" shell (which has SHLVL=2) is not another bash 
instance, 
but the terminal emulator (gnome-terminal-server, xterm, etc.).  This is 
expected.
Since the problem exists with various terminal emulators, the bug must be in 
generic gui initialization or gui-app startup code (not in gnome-terminal or 
xterm).

=> Speculation: Somewhere in the initial GUI startup code there is a
script executed by bash which starts long-running processes (systemd?)
and then exits.   SHLVL=1 is inherited in the environment by the child,
and so any shell the child later spawns set SHLVL=2.   If that's the
case, then it might suffice to "unset SHLVL" before starting the
child(ren).   Again, this is just speculation.

ProblemType: Bug
DistroRelease: Ubuntu 17.04
Package: unity 7.5.0+17.04.20170407.1-0ubuntu1
ProcVersionSignature: Ubuntu 4.10.0-28.32-generic 4.10.17
Uname: Linux 4.10.0-28-generic x86_64
NonfreeKernelModules: nvidia_uvm nvidia_drm nvidia_modeset nvidia
.proc.driver.nvidia.gpus.0000.03.00.0: Error: [Errno 21] Is a directory: 
'/proc/driver/nvidia/gpus/0000:03:00.0'
.proc.driver.nvidia.registry: Binary: ""
.proc.driver.nvidia.version:
 NVRM version: NVIDIA UNIX x86_64 Kernel Module  375.66  Mon May  1 15:29:16 
PDT 2017
 GCC version:  gcc version 6.3.0 20170406 (Ubuntu 6.3.0-12ubuntu2)
.proc.driver.nvidia.warnings.fbdev:
 Your system is not currently configured to drive a VGA console
 on the primary VGA device. The NVIDIA Linux graphics driver
 requires the use of a text-mode VGA console. Use of other console
 drivers including, but not limited to, vesafb, may result in
 corruption and stability problems, and is not supported.
.tmp.unity_support_test.0:
 
ApportVersion: 2.20.4-0ubuntu4.5
Architecture: amd64
BootLog: WDStockRoot: clean, 408304/4890624 files, 6257387/19531008 blocks
CompizPlugins: No value set for 
`/apps/compiz-1/general/screen0/options/active_plugins'
CompositorRunning: compiz
CompositorUnredirectDriverBlacklist: '(nouveau|Intel).*Mesa 8.0'
CompositorUnredirectFSW: true
CurrentDesktop: Unity:Unity7
Date: Tue Aug  1 10:07:13 2017
DistUpgraded: 2017-07-26 09:01:41,817 DEBUG Running PostInstallScript: 
'./xorg_fix_proprietary.py'
DistroCodename: zesty
DistroVariant: ubuntu
DkmsStatus:
 bbswitch, 0.8, 4.10.0-28-generic, x86_64: installed
 bbswitch, 0.8, 4.4.0-87-generic, x86_64: installed
 nvidia-375, 375.66, 4.10.0-28-generic, x86_64: installed
DpkgLog:
 
GconfCompiz:
 /apps/compiz-1/plugins:
   /apps/compiz-1/plugins/grid:
    /apps/compiz-1/plugins/grid/screen0:
     /apps/compiz-1/plugins/grid/screen0/options:
      top_edge_action = 0
GraphicsCard:
 NVIDIA Corporation GK208 [GeForce GT 630 Rev. 2] [10de:1284] (rev a1) (prog-if 
00 [VGA controller])
   Subsystem: ZOTAC International (MCO) Ltd. GK208 [GeForce GT 630 Rev. 2] 
[19da:1308]
InstallationDate: Installed on 2017-01-19 (194 days ago)
InstallationMedia: Ubuntu 16.04.1 LTS "Xenial Xerus" - Release amd64 (20160719)
MachineType: System manufacturer System Product Name
ProcKernelCmdLine: BOOT_IMAGE=/boot/vmlinuz-4.10.0-28-generic 
root=UUID=cc35a925-d0d6-4331-b791-4d52605d5a8d ro quiet splash vt.handoff=7
SourcePackage: unity
UpgradeStatus: Upgraded to zesty on 2017-07-26 (6 days ago)
dmi.bios.date: 09/21/2010
dmi.bios.vendor: American Megatrends Inc.
dmi.bios.version: 1408
dmi.board.asset.tag: To Be Filled By O.E.M.
dmi.board.name: P6T
dmi.board.vendor: ASUSTeK Computer INC.
dmi.board.version: Rev 1.xx
dmi.chassis.asset.tag: Asset-1234567890
dmi.chassis.type: 3
dmi.chassis.vendor: Chassis Manufacture
dmi.chassis.version: Chassis Version
dmi.modalias: 
dmi:bvnAmericanMegatrendsInc.:bvr1408:bd09/21/2010:svnSystemmanufacturer:pnSystemProductName:pvrSystemVersion:rvnASUSTeKComputerINC.:rnP6T:rvrRev1.xx:cvnChassisManufacture:ct3:cvrChassisVersion:
dmi.product.name: System Product Name
dmi.product.version: System Version
dmi.sys.vendor: System manufacturer
version.compiz: compiz 1:0.9.13.1+17.04.20170109-0ubuntu1
version.ia32-libs: ia32-libs N/A
version.libdrm2: libdrm2 2.4.76-1
version.libgl1-mesa-dri: libgl1-mesa-dri 17.0.3-1ubuntu1
version.libgl1-mesa-dri-experimental: libgl1-mesa-dri-experimental N/A
version.libgl1-mesa-glx: libgl1-mesa-glx 17.0.3-1ubuntu1
version.nvidia-graphics-drivers: nvidia-graphics-drivers-* N/A
version.xserver-xorg-core: xserver-xorg-core 2:1.19.3-1ubuntu1.1
version.xserver-xorg-input-evdev: xserver-xorg-input-evdev 1:2.10.5-1ubuntu1
version.xserver-xorg-video-ati: xserver-xorg-video-ati 1:7.9.0-0ubuntu1
version.xserver-xorg-video-intel: xserver-xorg-video-intel 
2:2.99.917+git20170309-0ubuntu1
version.xserver-xorg-video-nouveau: xserver-xorg-video-nouveau 1:1.0.14-0ubuntu1
xserver.bootTime: Tue Aug  1 09:56:34 2017
xserver.configfile: default
xserver.devices:
 input        Power Button         KEYBOARD, id 6
 input        Power Button         KEYBOARD, id 7
 input        Heng Yu Technology Deck 87 Francium Pro KEYBOARD, id 8
 input        Heng Yu Technology Deck 87 Francium Pro KEYBOARD, id 9
 input        ImPS/2 Generic Wheel Mouse MOUSE, id 10
xserver.errors:
 
xserver.logfile: /var/log/Xorg.0.log
xserver.outputs:
 
xserver.version: 2:1.19.3-1ubuntu1.1

** Affects: unity (Ubuntu)
     Importance: Undecided
         Status: New


** Tags: amd64 apport-bug compiz-0.9 ubuntu zesty

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1707977

Title:
  SHLVL=2 in outermost shell in unity terminals (REGRESSION)

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/unity/+bug/1707977/+subscriptions

-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to