lmod not working for zsh on knightly
I noticed that ml
is missing in the knightly instance. Initially thought it's because lmod is not enabled on the instance so was focused on enable_lmod
role. Now that the enable_lmod
role is working, then realize that lmod is not even installed on the node.
╭─ louistw ood-knightly ~ 3 ↵
╰─ ml
zsh: command not found: ml
╭─ louistw ood-knightly ~ 127 ↵
╰─ module
zsh: command not found: module
Activity
-
Newest first Oldest first
-
Show all activity Show comments only Show history only
- Bo-Chun Chen added Backlog label
added Backlog label
- Bo-Chun Chen marked this issue as related to #23
marked this issue as related to #23
- Bo-Chun Chen changed the description
changed the description
- Bo-Chun Chen assigned to @atlurie
assigned to @atlurie
- Bo-Chun Chen changed title from lmod missing from knightly build to lmod not working for zsh on knightly
changed title from lmod missing from knightly build to lmod not working for zsh on knightly
- Bo-Chun Chen assigned to @louistw and unassigned @atlurie
- Author Owner
After a little bit more testing, lmod does work on knightly, just not working if user uses zsh.
- Ravi Tripathi added Sprint 22-21 label and removed Backlog label
added Sprint 22-21 label and removed Backlog label
- Author Owner
Compared the sourced files from Knightly and Cheaha,
zsh
on Knightly doesn't source anything from/etc
:# Knightly $ /usr/local/bin/zsh -lix exit 2>&1 | sed -n 's/^[^>]\+> \(source\|\.\) //p' /home/louistw/.oh-my-zsh/oh-my-zsh.sh /home/louistw/.oh-my-zsh/tools/check_for_upgrade.sh /home/louistw/.oh-my-zsh/lib/compfix.zsh /home/louistw/.zcompdump-ood-knightly-5.7.1 /home/louistw/.oh-my-zsh/lib/bzr.zsh /home/louistw/.oh-my-zsh/lib/clipboard.zsh /home/louistw/.oh-my-zsh/lib/cli.zsh /home/louistw/.oh-my-zsh/lib/compfix.zsh /home/louistw/.oh-my-zsh/lib/completion.zsh /home/louistw/.oh-my-zsh/lib/correction.zsh /home/louistw/.oh-my-zsh/lib/diagnostics.zsh /home/louistw/.oh-my-zsh/lib/directories.zsh /home/louistw/.oh-my-zsh/lib/functions.zsh /home/louistw/.oh-my-zsh/lib/git.zsh /home/louistw/.oh-my-zsh/lib/grep.zsh /home/louistw/.oh-my-zsh/cache/grep-alias /home/louistw/.oh-my-zsh/lib/history.zsh /home/louistw/.oh-my-zsh/lib/key-bindings.zsh /home/louistw/.oh-my-zsh/lib/misc.zsh /home/louistw/.oh-my-zsh/lib/nvm.zsh /home/louistw/.oh-my-zsh/lib/prompt_info_functions.zsh /home/louistw/.oh-my-zsh/lib/spectrum.zsh /home/louistw/.oh-my-zsh/lib/termsupport.zsh /home/louistw/.oh-my-zsh/lib/theme-and-appearance.zsh /home/louistw/.oh-my-zsh/lib/vcs_info.zsh /home/louistw/.oh-my-zsh/plugins/z/z.plugin.zsh /home/louistw/.oh-my-zsh/plugins/z/z.sh /home/louistw/.oh-my-zsh/plugins/bundler/bundler.plugin.zsh /home/louistw/.oh-my-zsh/plugins/git/git.plugin.zsh /home/louistw/.oh-my-zsh/plugins/virtualenv/virtualenv.plugin.zsh /home/louistw/.oh-my-zsh/custom/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.plugin.zsh /home/louistw/.oh-my-zsh/custom/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh /home/louistw/.oh-my-zsh/custom/plugins/zsh-syntax-highlighting/highlighters/brackets/brackets-highlighter.zsh /home/louistw/.oh-my-zsh/custom/plugins/zsh-syntax-highlighting/highlighters/cursor/cursor-highlighter.zsh /home/louistw/.oh-my-zsh/custom/plugins/zsh-syntax-highlighting/highlighters/line/line-highlighter.zsh /home/louistw/.oh-my-zsh/custom/plugins/zsh-syntax-highlighting/highlighters/main/main-highlighter.zsh /home/louistw/.oh-my-zsh/custom/plugins/zsh-syntax-highlighting/highlighters/pattern/pattern-highlighter.zsh /home/louistw/.oh-my-zsh/custom/plugins/zsh-syntax-highlighting/highlighters/regexp/regexp-highlighter.zsh /home/louistw/.oh-my-zsh/custom/plugins/zsh-syntax-highlighting/highlighters/root/root-highlighter.zsh /home/louistw/.oh-my-zsh/custom/plugins/zsh-completions/zsh-completions.plugin.zsh /home/louistw/.oh-my-zsh/plugins/nvm/nvm.plugin.zsh /home/louistw/.oh-my-zsh/plugins/terraform/terraform.plugin.zsh /home/louistw/.oh-my-zsh/custom/aliases.zsh /home/louistw/.oh-my-zsh/custom/example.zsh /home/louistw/.oh-my-zsh/custom/themes/powerlevel10k/powerlevel10k.zsh-theme /home/louistw/.cache/p10k-dump-louistw.zsh /home/louistw/.oh-my-zsh/custom/themes/powerlevel10k/gitstatus/gitstatus.plugin.zsh /home/louistw/.oh-my-zsh/custom/themes/powerlevel10k/internal/p10k.zsh /home/louistw/.oh-my-zsh/custom/themes/powerlevel10k/internal/configure.zsh
# Cheaha: $ zsh -lix exit 2>&1 | sed -n 's/^[^>]\+> \(source\|\.\) //p' /etc/profile /etc/profile.d/256term.sh /etc/profile.d/99-quota-report.sh /etc/profile.d/bash_completion.sh /etc/profile.d/colorgrep.sh /etc/profile.d/colorls.sh /etc/profile.d/flatpak.sh /etc/profile.d/gnome-ssh-askpass.sh /etc/profile.d/lang.sh /etc/profile.d/less.sh /etc/profile.d/man.sh /etc/profile.d/modules.sh /etc/sysconfig/modules/init.sh /etc/sysconfig/modules/lmod/00-modulepath.sh /etc/sysconfig/modules/lmod/z00-lmod.sh /usr/share/lmod/lmod/init/zsh /etc/sysconfig/modules/lmod/z01-default_modules.sh /etc/profile.d/mpi-selector.sh /etc/profile.d/qt-graphicssystem.sh /etc/profile.d/qt.sh /etc/profile.d/rc.sh /etc/profile.d/srvadmin-path.sh /etc/profile.d/ssh.sh /etc/profile.d/vim.sh /etc/profile.d/vte.sh /etc/profile.d/which2.sh /etc/profile.d/sh.local /home/louistw/.oh-my-zsh/oh-my-zsh.sh /home/louistw/.oh-my-zsh/tools/check_for_upgrade.sh /home/louistw/.oh-my-zsh/lib/compfix.zsh /home/louistw/.zcompdump-login005-5.7.1 /home/louistw/.oh-my-zsh/lib/bzr.zsh /home/louistw/.oh-my-zsh/lib/clipboard.zsh /home/louistw/.oh-my-zsh/lib/cli.zsh /home/louistw/.oh-my-zsh/lib/compfix.zsh /home/louistw/.oh-my-zsh/lib/completion.zsh /home/louistw/.oh-my-zsh/lib/correction.zsh /home/louistw/.oh-my-zsh/lib/diagnostics.zsh /home/louistw/.oh-my-zsh/lib/directories.zsh /home/louistw/.oh-my-zsh/lib/functions.zsh /home/louistw/.oh-my-zsh/lib/git.zsh /home/louistw/.oh-my-zsh/lib/grep.zsh /home/louistw/.oh-my-zsh/cache/grep-alias /home/louistw/.oh-my-zsh/lib/history.zsh /home/louistw/.oh-my-zsh/lib/key-bindings.zsh /home/louistw/.oh-my-zsh/lib/misc.zsh /home/louistw/.oh-my-zsh/lib/nvm.zsh /home/louistw/.oh-my-zsh/lib/prompt_info_functions.zsh /home/louistw/.oh-my-zsh/lib/spectrum.zsh /home/louistw/.oh-my-zsh/lib/termsupport.zsh /home/louistw/.oh-my-zsh/lib/theme-and-appearance.zsh /home/louistw/.oh-my-zsh/lib/vcs_info.zsh /home/louistw/.oh-my-zsh/plugins/z/z.plugin.zsh /home/louistw/.oh-my-zsh/plugins/z/z.sh /home/louistw/.oh-my-zsh/plugins/bundler/bundler.plugin.zsh /home/louistw/.oh-my-zsh/plugins/git/git.plugin.zsh /home/louistw/.oh-my-zsh/plugins/virtualenv/virtualenv.plugin.zsh /home/louistw/.oh-my-zsh/custom/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.plugin.zsh /data/user/home/louistw/.oh-my-zsh/custom/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh /data/user/home/louistw/.oh-my-zsh/custom/plugins/zsh-syntax-highlighting/highlighters/brackets/brackets-highlighter.zsh /data/user/home/louistw/.oh-my-zsh/custom/plugins/zsh-syntax-highlighting/highlighters/cursor/cursor-highlighter.zsh /data/user/home/louistw/.oh-my-zsh/custom/plugins/zsh-syntax-highlighting/highlighters/line/line-highlighter.zsh /data/user/home/louistw/.oh-my-zsh/custom/plugins/zsh-syntax-highlighting/highlighters/main/main-highlighter.zsh /data/user/home/louistw/.oh-my-zsh/custom/plugins/zsh-syntax-highlighting/highlighters/pattern/pattern-highlighter.zsh /data/user/home/louistw/.oh-my-zsh/custom/plugins/zsh-syntax-highlighting/highlighters/regexp/regexp-highlighter.zsh /data/user/home/louistw/.oh-my-zsh/custom/plugins/zsh-syntax-highlighting/highlighters/root/root-highlighter.zsh /home/louistw/.oh-my-zsh/custom/plugins/zsh-completions/zsh-completions.plugin.zsh /home/louistw/.oh-my-zsh/plugins/nvm/nvm.plugin.zsh /home/louistw/.oh-my-zsh/plugins/terraform/terraform.plugin.zsh /home/louistw/.oh-my-zsh/custom/aliases.zsh /home/louistw/.oh-my-zsh/custom/example.zsh /home/louistw/.oh-my-zsh/custom/themes/powerlevel10k/powerlevel10k.zsh-theme /home/louistw/.cache/p10k-dump-louistw.zsh /home/louistw/.oh-my-zsh/custom/themes/powerlevel10k/gitstatus/gitstatus.plugin.zsh /data/user/home/louistw/.oh-my-zsh/custom/themes/powerlevel10k/internal/p10k.zsh /data/user/home/louistw/.oh-my-zsh/custom/themes/powerlevel10k/internal/configure.zsh
- Owner
The issue lies in how ZSH loads the profile (see the green check answer here https://unix.stackexchange.com/questions/537637/sshing-into-system-with-zsh-as-default-shell-doesnt-run-etc-profile)
On Cheaha, we have both a
yum install zsh
installed version and a compiled version under/usr/loca/{bin,lib,share}
The RPM places the following files in
/etc
, one or multiple of which sources/etc/profile
, which in turn processes/etc/profile.d/*.sh
$ rpm -ql zsh | grep '/etc' /etc/skel/.zshrc /etc/zlogin /etc/zlogout /etc/zprofile /etc/zshenv /etc/zshrc
I have installed the RPM on Knightly to demonstrate, now
modules
works after login for ZSH users - Author Owner
As @mhanby suggested, will include yum version of zsh installed in the knightly.
And here is the zsh spec file I found online for future improvement:
https://src.fedoraproject.org/rpms/zsh/blob/rawhide/f/zsh.spec
Edited by Bo-Chun Chen - Owner
I'll build the RPM on my test VM and see how it behaves
- Owner
Ok, here's my build script for ZSH using the Git repo used by Fedora to build their RPM: https://src.fedoraproject.org/rpms/zsh/tree/rawhide
The way this script is written, it clones the repo, downloads the source and builds all in the same working directory, resulting in a tree that looks like this when the build is complete (note I restricted the output for brevity):
$ tree -L 3 . ├── BUILD │ └── zsh-5.9 ├── BUILDROOT ├── build-zsh2.sh ├── build-zsh.sh ├── RPMS │ ├── noarch │ │ └── zsh-html-5.9-2.el7.noarch.rpm │ └── x86_64 │ ├── zsh-5.9-2.el7.x86_64.rpm │ └── zsh-debuginfo-5.9-2.el7.x86_64.rpm ├── SOURCES │ ├── dotzprofile │ ├── dotzshrc │ ├── zlogin.rhs │ ├── zlogout.rhs │ ├── zprofile.rhs │ ├── zsh-5.9.tar.xz │ ├── zshenv.rhs │ └── zshrc.rhs ├── SPECS │ └── zsh.spec ├── SRPMS └── zsh ├── dotzprofile ├── dotzshrc ├── plans ├── sources ├── zlogin.rhs ├── zlogout.rhs ├── zprofile.rhs ├── zshenv.rhs ├── zshrc.rhs └── zsh.spec 11 directories, 20 files
To use, create a working directory, cd into it, copy and paste the heredoc to create the script.
chmod +x build-zsh.sh
and then run it. If all goes well, you'll have an installable RPMRPMS/x86_64/zsh-5.9-2.el7.x86_64.rpm
cat <<-'EOF' > build-zsh.sh #!/bin/bash name=zsh version=5.9 mkdir -p BUILD RPMS SOURCES SPECS SRPMS prereqs="git epel-release bzip2 xz gzip tar" rpm -q $prereqs if [ $? -ne 0 ]; then sudo yum -y install $prereqs; fi git clone https://src.fedoraproject.org/rpms/${name}.git cp ${name}/${name}.spec SPECS/ cp ${name}/*.rhs SOURCES/ cp ${name}/dot* SOURCES/ # Perl may not be available, switching to sed #perl -pi -e 's/^(BuildRequires: glibc-langpack-ja)/#$1/g;' ${name}/${name}.spec sed -i '/BuildRequires: glibc-langpack-ja/s/^/#/' SPECS/${name}.spec pkgs="rpm-build $(grep -E '^BuildRequires|^Requires' SPECS/${name}.spec | awk '{print $2}' | tr '\n' ' ')"; echo $pkgs rpm -q $pkgs if [ $? -ne 0 ]; then sudo yum install -y $pkgs; fi if [ ! -f SOURCES/${name}-${version}.tar.xz ] ; then curl -L -o SOURCES/${name}-${version}.tar.xz https://downloads.sourceforge.net/${name}/${name}-${version}.tar.xz fi if [ ! -f SOURCES/${name}-${version}.tar.xz.asc ] ; then curl -L -o SOURCES/${name}-${version}.tar.xz.asc https://downloads.sourceforge.net/${name}/${name}-${version}.tar.xz.asc fi cd SOURCES sha512sum -c ../${name}/sources retval=$? cd - if [ $retval -ne 0 ]; then # echo "SOURCES/${name}-${version}.tar.gz did not match checksum in ${name}/source" exit 1 fi rpmbuild --define "_topdir `pwd`" -bb SPECS/${name}.spec EOF
Edited by Mike Hanby - Author Owner
Put the rpm file in s3 bucket at s3://cheaha-cloud-ansible-files/zsh-5.9-2.el7.x86_64.rpm
Changed the ansible to install dependencies before installing the rpm file. 385769a2
Edited by Bo-Chun Chen - Bo-Chun Chen closed
closed