You are not logged in.
Pages: 1
I have checked inside "/etc/zsh/zprofile":
emulate sh -c 'source /etc/profile'If I do ". /etc/zsh/zprofile" all works like a charm.
$ echo $SHELL
/bin/zshI have try to check the GLOBAL_RCS (echo $GLOBAL_RCS) and is unset, but also if I set it (with "export GLOBAL_RCS=1" in /etc/zsh/zshenv) nothing change.
thanks in advance
Last edited by elbowz (2019-08-06 07:56:23)
Offline
How are you starting zsh? Those files are/should be only sourced on login shells.
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
I'm starting it in the login shell
edit: if add: "emulate sh -c 'source /etc/profile'" in "~/.zshrc" all works good
for some reason "/etc/zsh/zprofile" is not called (sourced)
Last edited by elbowz (2019-08-05 12:11:31)
Offline
I'm starting it in the login shell
More specifically please. This could be a misused word here, but starting zsh in a login shell would nout result in /etc/zprofile being source; zsh itself must be started as a login shell.
Have you used chsh to change the default shell to zsh and logged in to a new tty to use zsh? Or have you passed specific flags to start zsh as a login shell session? How exactly are you starting zsh?
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
elbowz wrote:I'm starting it in the login shell
More specifically please. This could be a misused word here, but starting zsh in a login shell would nout result in /etc/zprofile being source; zsh itself must be started as a login shell.
Have you used chsh to change the default shell to zsh and logged in to a new tty to use zsh? Or have you passed specific flags to start zsh as a login shell session? How exactly are you starting zsh?
Sorry for my bad English.
I have put "/bin/zsh" in the last column of my user in the "/etc/password" and restart the pc.
$ cat /etc/passwd | grep mysuer
myuser:x:1000:100::/home/myuser:/bin/zshOffline
How do you determine that it's not sourced instead of eg. some desired value being unset/overridden later on?
strace zsh -l 2>&1 | grep profile?
Online
$ strace zsh -l 2>&1 | grep profile
access("/home/user/.zprofile", F_OK) = -1 ENOENT (No such file or directory)
stat("/etc/zsh/zprofile.zwc", 0x7ffdc5a876f0) = -1 ENOENT (No such file or directory)
stat("/etc/zsh/zprofile", {st_mode=S_IFREG|0644, st_size=36, ...}) = 0
openat(AT_FDCWD, "/etc/zsh/zprofile", O_RDONLY|O_NOCTTY) = 3
access("/etc/profile", F_OK) = 0
stat("/etc/profile", {st_mode=S_IFREG|0644, st_size=759, ...}) = 0it seems load correctly the zprofile file... in fact if I execute "zsh -l" in the terminal emulator all works.
I have just discovered the issue appear only in the "graphical terminal emulator" (eg. Konsole on KDE), not on tty (Ctrl+Alt+F2).
edit: maybe this is the reason: https://askubuntu.com/a/503918
Last edited by elbowz (2019-08-05 14:16:09)
Offline
This is precisely why I was asking whether this is actually a login shell. In a terminal emulator you generally are not running a login shell.
I also gather you start X via a display manager, otherwise the desired environment would be inherited from the tty login shell.
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
Yeah, that's kinda important …
However, this is an xy-problem. Afaiu you're not interested in /etc/zsh/zprofile but in /etc/profile and that should be typically loaded by whatever starts your (GUI) session - and that would be…??
Edit: pecked by a domesticated parrot
Last edited by seth (2019-08-05 14:21:46)
Online
This is precisely why I was asking whether this is actually a login shell. In a terminal emulator you generally are not running a login shell.
I also gather you start X via a display manager, otherwise the desired environment would be inherited from the tty login shell.
Sorry, I don't know the difference by login, non-login, interactive and non-interactive shell...something to study ![]()
Yes, Kde should be started by SDDM.
Thanks for the patience!
Offline
Yeah, that's kinda important …
However, this is an xy-problem. Afaiu you're not interested in /etc/zsh/zprofile but in /etc/profile and that should be typically loaded by whatever starts your (GUI) session - and that would be…??
Edit: pecked by a domesticated parrot
Sorry, what you mean?
I have some aliases and environment variables "shared" by the system users, so I guess that the right place was /etc/profile.d/*
eg.
* I want all system users have the alias "alias ll='ls -alF'"
* or something in the PATH variable (eg. ANDROID_SDK)
Offline
The parrot is a reference to Trilby, the other thing is: how do you start … KDE (I guess)? eg. sddm, startx, …
Aliases do typically not belong into the profile, because they relate to interactive shells. You may want to use /etc/zsh/zshrc
Online
I have moved all stuffs that run at each started shell (eg. terminal emulator aka non-login shell) and is not propagated from sub-shell (eg. alias) in '/etc/zsh/zshrc'.
Now works like a charm.
Thanks to both and to the Archlinux wonderful community!
Offline
Just for reference, SDDM sources /etc/zsh/zprofile (see /usr/share/sddm/scripts/Xsession). So it's strange that it didn't work for you.
Offline
Just for reference, SDDM sources /etc/zsh/zprofile (see /usr/share/sddm/scripts/Xsession). So it's strange that it didn't work for you.
You have right, but aliases set in the /etc/zsh/zprofile will be not present in the terminal emulator.
This, if I have well understood, is because:
* alias is not propagated to sub-shell
* terminal emulator is a non-login shell => not source the /etc/zsh/zprofile
Last edited by elbowz (2019-08-06 14:14:13)
Offline
* alias is not propagated to sub-shell
* terminal emulator is a non-login shell => not source the /etc/zsh/zprofile
Ah, now I get it.
Offline
Pages: 1