bash since the dawn of history. I didn’t change the server config but upgraded them as well as the CI servers. It stopped working everywhere.# finger root && cat /etc/profile | grep export && locale && echo $EDITOR
Login: root Name: Charlie Root
Directory: /root Shell: /usr/local/bin/bash
Last login Mon Nov 16 04:52 (CET) on ttyv0
No Mail.
No Plan.
# BLOCKSIZE=K; export BLOCKSIZE
export LANG=en_US.UTF-8
export LC_ALL=en_US.UTF-8
export EDITOR=nano
LANG=
LC_CTYPE="C"
LC_COLLATE="C"
LC_TIME="C"
LC_NUMERIC="C"
LC_MONETARY="C"
LC_MESSAGES="C"
LC_ALL=
#
20200716:
AFFECTS: users of shells/bash, shells/bash-static
AUTHOR: ehaupt@FreeBSD.org
In order to cleanly decouple bash from base, bash now reads `profile` from
LOCALBASE/etc insead of from /etc. If you are using system wide bash
configuration in /etc/profile please migrate to LOCALBASE/etc/profile
# cp /etc/profile /usr/local/etc/profile
or create a symlink
# ln -s /etc/profile /usr/local/etc/
If you encounter the following error, you may have the obsolete
/lib/libreadline.so.8 lying around after an incomplete base update:
ld-elf.so.1: Undefined symbol "rl_signal_event_hook" referenced from COPY relocation in /usr/local/bin/bash
Please refer to to (23.5.6.2) in the FreeBSD Handbook on how to
safely check for outdated files and libraries:
https://www.freebsd.org/doc/en/books/handbook/makeworld.html
/usr/local/etc/profile if it exists, which it doesn't. The online manual instead mentions /etc/profile, which does exist, and is constructed to load everything you would expect it to, but it itself is not loaded. This makes sense, given the information in SirDice's post, but then why do new installations still only get /etc/profile? And why the discrepancy between the manual pages? Am I missing something?It's used by sh(1), which is included in the base OS (and set as the default shell nowadays). Bash isn't. It's built and installed using the LOCALBASE prefix, which is /usr/local on FreeBSD. So $LOCALBASE/etc/profile points to /usr/local/etc/profile. The code itself is compiled this way, but the man page that's included with the source of bash, probably doesn't account for the PREFIX change, it's copied 1-to-1.but then why do new installations still only get/etc/profile?
@${REINPLACE_CMD} -e "s|%%PREFIX%%|${PREFIX}|g" -e "s|%%LOCALBASE%%|${LOCALBASE}|g" \
-e "s|\(/etc/profile\)|${PREFIX}\1|g" \
${WRKSRC}/doc/bash.1
--noprofile
Do not read either the system-wide startup file
/usr/local/etc/profile or any of the personal initialization
files ~/.bash_profile, ~/.bash_login, or ~/.profile. By
default, bash reads these files when it is invoked as a login
shell (see INVOCATION below).
--noprofile
Do not read either the system-wide startup file /etc/profile or
any of the personal initialization files ~/.bash_profile,
~/.bash_login, or ~/.profile. By default, bash reads these
files when it is invoked as a login shell (see INVOCATION be-
low).
diff --git a/shells/bash/Makefile b/shells/bash/Makefile
index f320b9b85148..d7bec622b1a6 100644
--- a/shells/bash/Makefile
+++ b/shells/bash/Makefile
@@ -84,7 +84,7 @@ post-patch:
${RM} ${WRKSRC}/y.tab.c
@${REINPLACE_CMD} -e "s|%%PREFIX%%|${PREFIX}|g" -e "s|%%LOCALBASE%%|${LOCALBASE}|g" \
-e "s|\(/etc/profile\)|${PREFIX}\1|g" \
- ${WRKSRC}/doc/bash.1
+ ${WRKSRC}/doc/bash.1 ${WRKSRC}/doc/bash.html
--noprofile
Do not read either the system-wide startup file /usr/local/etc/profile or
any of the personal initialization files ~/.bash_profile, ~/.bash_login, or
~/.profile. By default, bash reads these files when it is invoked as a
login shell (see INVOCATION below).
Edited.If I remember correctly the man pages on https://man.freebsd.org/cgi/man.cgi are generated from a port's (and base OS) man pages. Don't think they're using the HTML documentation.
Right. I guess my next question would be whyIt's used by sh(1), which is included in the base OS (and set as the default shell nowadays).
/usr/local/etc/profile is not shipped with bash, but I guess maybe to avoid conflicts with sh. So I do in fact need something like the script posted by dreibh.It's not shipped with bash because it's entirely system dependant. You may or may not have noticed, in general, ports install fairly standard configuration files that came with the original distribution (which is why they often need a bit of tweaking to get it to work on FreeBSD). There is no profile script that comes with the bash distfiles.I guess my next question would be why/usr/local/etc/profileis not shipped with bash