Mageia Bugzilla – Attachment 11816 Details for
Bug 27160
Processing /etc/profile.d/lang.sh at autologin is time consuming / slow (~10 seconds)
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
New Account
|
Forgot Password
modified zshrc with profiling logging
zshrc (text/plain), 2.31 KB, created by
Shlomi Fish
on 2020-08-21 13:40:14 CEST
(
hide
)
Description:
modified zshrc with profiling logging
Filename:
MIME Type:
Creator:
Shlomi Fish
Created:
2020-08-21 13:40:14 CEST
Size:
2.31 KB
patch
obsolete
># ># /etc/zshrc is sourced in interactive shells. It contain the basic ># configuration for keys umask PROMPT and variable ># If no ~/.zshrc exist then load the default ># /usr/share/zsh/$ZSH_VERSION/zshrc_default ># ># If you have problems about this semantics please send comment to : ># Chmouel Boudjnah <chmouel@mandrakesoft.com> >logg() >{ > local str="$1" > shift > local param="$1" > shift > printf "time = %s ; < %s > param=%s\\n" "$(date +"%s.%N")" "$str" "$param" >> /tmp/zsh-shlomify-logg-0.1.txt >} > >logg "etc/start" "s" >if [[ $(id -gn) = $USERNAME && $EUID -gt 14 ]]; then > umask 002 >else > umask 022 >fi > ># Get keys working >(( ${+terminfo[kich1]} )) && bindkey "${terminfo[kich1]}" yank >(( ${+terminfo[kdch1]} )) && bindkey "${terminfo[kdch1]}" delete-char >(( ${+terminfo[kpp]} )) && bindkey "${terminfo[kpp]}" up-line-or-history >(( ${+terminfo[knp]} )) && bindkey "${terminfo[knp]}" down-line-or-history >(( ${+terminfo[khome]} )) && bindkey "${terminfo[khome]}" beginning-of-line >(( ${+terminfo[kend]} )) && bindkey "${terminfo[kend]}" end-of-line > ># Home/End often do not correspond to terminfo; ># For Beginning/end of line pickup the good one ># ># XTerm: ># bindkey "^[[1~" beginning-of-line ># bindkey "^[[4~" end-of-line ># ># RXVT: ># bindkey "^[[7~" beginning-of-line ># bindkey "^[[8~" end-of-line ># ># Gnome/KDE-Terminal: ># bindkey "^[OF" end-of-line ># bindkey "^[OH" beginning-of-line ># > ># Set default window title >if [[ $TERM = "xterm" || $TERM = "rxvt" ]];then > precmd () { print -Pn "\e]0;%n@%m: %~\a" } >fi > ># Set prompts >PROMPT="%n@%m %3~ %(!.#.$) " # default prompt >#RPROMPT=' %~' # prompt for right side of screen > >logg "etc/foo" "s" ># Some environment variables >path=($path $HOME/bin) >export HISTFILE=${HOME}/.bash_history >export HISTSIZE=1000 >export SAVEHIST=1000 >export USER=$USERNAME >export HOSTNAME=$HOST > ># bindkey -v # vi key bindings >bindkey -e # emacs key bindings > >logg "etc/bef-profile_func" "s" >for profile_func in /etc/profile.d/*.sh >do >logg "etc/in-profile_func" "${profile_func}" > emulate -R sh -c "source $profile_func" >done >unset profile_func > ># See comment at top. >if [[ ! -r ${ZDOTDIR:-$HOME}/.zshrc ]];then > if [[ -f /usr/share/zsh/$ZSH_VERSION/zshrc_default ]];then > source /usr/share/zsh/$ZSH_VERSION/zshrc_default > fi >fi >logg "etc/end_func" "s"
# # /etc/zshrc is sourced in interactive shells. It contain the basic # configuration for keys umask PROMPT and variable # If no ~/.zshrc exist then load the default # /usr/share/zsh/$ZSH_VERSION/zshrc_default # # If you have problems about this semantics please send comment to : # Chmouel Boudjnah <chmouel@mandrakesoft.com> logg() { local str="$1" shift local param="$1" shift printf "time = %s ; < %s > param=%s\\n" "$(date +"%s.%N")" "$str" "$param" >> /tmp/zsh-shlomify-logg-0.1.txt } logg "etc/start" "s" if [[ $(id -gn) = $USERNAME && $EUID -gt 14 ]]; then umask 002 else umask 022 fi # Get keys working (( ${+terminfo[kich1]} )) && bindkey "${terminfo[kich1]}" yank (( ${+terminfo[kdch1]} )) && bindkey "${terminfo[kdch1]}" delete-char (( ${+terminfo[kpp]} )) && bindkey "${terminfo[kpp]}" up-line-or-history (( ${+terminfo[knp]} )) && bindkey "${terminfo[knp]}" down-line-or-history (( ${+terminfo[khome]} )) && bindkey "${terminfo[khome]}" beginning-of-line (( ${+terminfo[kend]} )) && bindkey "${terminfo[kend]}" end-of-line # Home/End often do not correspond to terminfo; # For Beginning/end of line pickup the good one # # XTerm: # bindkey "^[[1~" beginning-of-line # bindkey "^[[4~" end-of-line # # RXVT: # bindkey "^[[7~" beginning-of-line # bindkey "^[[8~" end-of-line # # Gnome/KDE-Terminal: # bindkey "^[OF" end-of-line # bindkey "^[OH" beginning-of-line # # Set default window title if [[ $TERM = "xterm" || $TERM = "rxvt" ]];then precmd () { print -Pn "\e]0;%n@%m: %~\a" } fi # Set prompts PROMPT="%n@%m %3~ %(!.#.$) " # default prompt #RPROMPT=' %~' # prompt for right side of screen logg "etc/foo" "s" # Some environment variables path=($path $HOME/bin) export HISTFILE=${HOME}/.bash_history export HISTSIZE=1000 export SAVEHIST=1000 export USER=$USERNAME export HOSTNAME=$HOST # bindkey -v # vi key bindings bindkey -e # emacs key bindings logg "etc/bef-profile_func" "s" for profile_func in /etc/profile.d/*.sh do logg "etc/in-profile_func" "${profile_func}" emulate -R sh -c "source $profile_func" done unset profile_func # See comment at top. if [[ ! -r ${ZDOTDIR:-$HOME}/.zshrc ]];then if [[ -f /usr/share/zsh/$ZSH_VERSION/zshrc_default ]];then source /usr/share/zsh/$ZSH_VERSION/zshrc_default fi fi logg "etc/end_func" "s"
View Attachment As Raw
Actions:
View
Attachments on
bug 27160
: 11816