# What happened to /etc/profile?



## Mage (Jan 13, 2021)

Some time ago, my servers started ignoring the content of /etc/profile

I have lines there that export LANG, LC_ALL, and EDITOR. It used to work. What’s the problem?


----------



## SirDice (Jan 13, 2021)

I'm going to guess you're not using a bourne (or compatible) shell (sh(1), bash(1), etc), those are the only ones that actually read it, csh(1) and tcsh(1) don't.

Note that you should NOT set LC_ALL to change your locale(1) settings. It's used to overrule all other locale(1) settings. It's not meant to be used as a "user" setting.


----------



## Mage (Jan 13, 2021)

I have been using `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=

#
```


----------



## SirDice (Jan 13, 2021)

Hmm. Something I overlooked with regards to bash (I don't use it):

```
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
```


----------



## Mage (Jan 13, 2021)

Yes, it started about a half year ago. Thank you, SirDice. I didn’t find it.

Although I don’t find this change logical. The point of /etc/profile is to set it for all users and any shell. Bash should read both /etc/profile and something like /usr/local/etc/bash_profile


----------

