[Bug 1800280] [NEW] Setting ZSH as the default shell causes various issues because it doesn't source /etc/profile

Axel Beckert abe at debian.org
Sat Nov 3 15:13:50 UTC 2018


Hi Martin,

Martin wrote:
> When setting ZSH as the default shell, /etc/profile is never sourced

What do you exactly mean by "setting ZSH as the default shell"?

A) Using it as login shell for a specific user.
B) Letting the /bin/sh symlink point to it.

Case B is definitely not supported and explicitly discouraged by
upstream.

> /etc/profile.d/apps-bin-path.sh adds /var/lib/snapd/desktop to
> XDG_DATA_DIRS. Setting the default shell to ZSH means that desktop
> environments suddenly can't launch snap packages.

This sounds more like case B to me.

> Arch Linux's zsh package has `emulate sh -c 'source /etc/profile'` in
> /etc/zsh/zprofile. Either Ubuntu's zsh package should do the same (or
> something similar), or Ubuntu must put important environment variable
> stuff somewhere else and have only bash-specific stuff in /etc/profile
> and /etc/profile.d.

IMHO the latter needs to happen. Zsh upstream does not source
/etc/profile and users won't expect it to do that and doing it will
probably cause other user irritations and unexcpected subtle side
effects.

See https://tanguy.ortolo.eu/blog/article25/shrc for reference what
each shell loads in which case.

		Regards, Axel
-- 
 ,''`.  |  Axel Beckert <abe at debian.org>, https://people.debian.org/~abe/
: :' :  |  Debian Developer, ftp.ch.debian.org Admin
`. `'   |  4096R: 2517 B724 C5F6 CA99 5329  6E61 2FF9 CD59 6126 16B5
  `-    |  1024D: F067 EA27 26B9 C3FC 1486  202E C09E 1D89 9593 0EDE

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

Title:
  Setting ZSH as the default shell causes various issues because it
  doesn't source /etc/profile

Status in zsh package in Ubuntu:
  New

Bug description:
  When setting ZSH as the default shell, /etc/profile is never sourced
  (because ZSH instead sources its own /etc/zsh/zprofile). That's
  problematic, because /etc/profile (and the files in /etc/profile.d)
  are responsible for a bunch of important stuff. For example:

  /etc/profile.d/apps-bin-path.sh adds /var/lib/snapd/desktop to
  XDG_DATA_DIRS. Setting the default shell to ZSH means that desktop
  environments suddenly can't launch snap packages.

  /etc/profile.d/input-method-config.sh works around
  https://bugs.launchpad.net/ubuntu/+source/gdm3/+bug/1720250, so
  setting the default shell to ZSH un-fixes that bug.

  Arch Linux's zsh package has `emulate sh -c 'source /etc/profile'` in
  /etc/zsh/zprofile. Either Ubuntu's zsh package should do the same (or
  something similar), or Ubuntu must put important environment variable
  stuff somewhere else and have only bash-specific stuff in /etc/profile
  and /etc/profile.d.

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



More information about the foundations-bugs mailing list