When there is no .zshrc
file in a user's home directory and zsh
is started, an interactive configuration utility is run instead of directly giving access to the shell prompt.
I set up zsh
to be the default shell on my Debian Wheezy systems. Therefore every newly created user gets zsh
as login shell if I do not change that manually. Also there is a default .zshrc
in /etc/skel
, so all regular users on my system have a copy of the file in their home directory. This is not the case for system users.
When I now change into a system user (for example the user for a specific network daemon) via sudo
or sh
I run into the configuration tool, because these users have no .zshrc
in their home directories.
It doesn't feel right to place a .zshrc
into each and every daemon's home directory, which also would be a pain to setup and maintain on a lot of systems. But I still wouldn't want to downgrade to a less comfortable bash
for these users.
Is there a way to disable the zsh
configuration tool without having to create a .zshrc
file in the user's home directory? Additionally a way to setup a single file to be the system-wide default .zshrc
for all users which don't have one would be nice too.
Best Answer
from: http://www.zsh.org/mla/users/2007/msg00398.html
and
/etc/zsh/zshrc
is sourced by every shell that has theinteractive
,rcs
, &globalrc
options set. (which most interactive zsh processes do)or add
zsh-newuser-install() { :; }
in/etc/zsh/zshenv
Which has the obvious side-effect of users not being able to use the function until they undefine yours.You can refine that by adding a test of the UID.