Need to set LANG in script called via udev rule
December 15, 2020 —
BarryK
Forum member Esmourguit is testing the French build of EasyOS
2.5.3, and found PupCamera displays in French when launched from the
menu, only in English when it launches automatically -- in response to
plugging in a PTP device such as camera or phone.
I recently posted about fixing those scripts that are called via udev rules:
https://bkhome.org/news/202012/how-to-run-long-time-process-on-udev-event.html
However, there was one oversight -- the LANG variable is not set when the script is called via udev. These scripts are affected:
/usr/sbin/pupautodetect-run
/usr/local/pup_event/bluetooth-add, bluetooth-remove, bluetoothhw
So I have inserted this code in the scripts:
#20201215 if called from udev rule, LANG will not be set...
eval $(grep '^LANG=.*' /etc/profile)
export LANG
Tags: easy