Skip to content
View in the app

A better way to browse. Learn more.

Unraid

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

locale LC_ALL issue

Featured Replies

I have a bash script that displays the following error before it even starts (the error is displayed as soon as bash is called/launched):

 

/bin/bash: warning: setlocale: LC_ALL: cannot change locale (en_US)

 

I have to get rid of this error, the script is launched through inetd by my monitoring server and it can't parse the output because of that error at the beginning. So I checked locale:

 

root@server:~# locale
LANG=en_US.UTF-8
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE=C
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=

 

Seems like an easy fix would be to change LC_ALL to en_US.UTF-8 here. How do I do that in Unraid?

Edited by dnLL

  • Author

I tried editing my .bash_profile without any success. I tried adding export LC_ALL=C and export LC_ALL="en_US.UTF-8" but I still get the same error, it's as if the .bash_profile wasn't loaded when the script is started by xinetd.

  • Author

Here is a full example:

 

root@server:~# cat /usr/bin/check_mk_agent
#!/bin/bash
echo "test"

root@server:~# /usr/bin/check_mk_agent
test

root@server:~# telnet localhost 6556
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
/bin/bash: warning: setlocale: LC_ALL: cannot change locale (en_US)
test
Connection closed by foreign host.

 

  • Author

Something more interesting:

 

root@server:~# cat /usr/bin/check_mk_agent
#!/bin/bash
locale

root@server:~# /usr/bin/check_mk_agent
LANG=en_US.UTF-8
LC_CTYPE="en_US.UTF8"
LC_NUMERIC="en_US.UTF8"
LC_TIME="en_US.UTF8"
LC_COLLATE="en_US.UTF8"
LC_MONETARY="en_US.UTF8"
LC_MESSAGES="en_US.UTF8"
LC_PAPER="en_US.UTF8"
LC_NAME="en_US.UTF8"
LC_ADDRESS="en_US.UTF8"
LC_TELEPHONE="en_US.UTF8"
LC_MEASUREMENT="en_US.UTF8"
LC_IDENTIFICATION="en_US.UTF8"
LC_ALL=

root@server:~# telnet localhost 6556
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
/bin/bash: warning: setlocale: LC_ALL: cannot change locale (en_US)
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
LANG=en_US
LC_CTYPE="en_US"
LC_NUMERIC="en_US"
LC_TIME="en_US"
LC_COLLATE="en_US"
LC_MONETARY="en_US"
LC_MESSAGES="en_US"
LC_PAPER="en_US"
LC_NAME="en_US"
LC_ADDRESS="en_US"
LC_TELEPHONE="en_US"
LC_MEASUREMENT="en_US"
LC_IDENTIFICATION="en_US"
LC_ALL=en_US
Connection closed by foreign host.

root@server:~# locale -a
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_COLLATE to default locale: No such file or directory
C
POSIX
en_US.utf8

 

xinetd launching the bash script is trying for some reason en_us which isn't supported by Unraid.

Edited by dnLL

  • Author

Fixed it by editing /etc/rc.d/rc.xinetd, changed all the en_us to en_us.utf-8. Now I need to script this to prevent this from happening again next reboot.

Archived

This topic is now archived and is closed to further replies.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.