nan0s7 / nfancurve

A small and lightweight POSIX script for using a custom fan curve in Linux for those with an Nvidia GPU.
GNU General Public License v3.0
314 stars 57 forks source link

Set en_US locale when running systemd service #43

Closed udalov closed 3 years ago

udalov commented 3 years ago

Before this change, nvidia-settings reported the following warning every time nfancurve invoked it:

Jun 21 19:08:22 arch nvidia-settings[37916]: Locale not supported by C library.
                                                     Using the fallback 'C' locale.

which polluted journalctl for no good reason. Perhaps this is related to the fact that systemd services start with empty environment. Setting some specific locale, for example en_US.UTF-8, prevents this warning from being reported.

nan0s7 commented 3 years ago

Oh weird. I assume the UTF-8 is your timezone? If there is one for every time zone, perhaps it'd be better to get the user to input their timezone? Unless it's just that nvidia-settings is compiled with a specific C locale?

udalov commented 3 years ago

Sorry, it turned out I had some weird locale set up in LC_MONETARY. I admit I don't understand how it works and why this workaround helped. I've set LC_MONETARY=C and the warnings are gone, no need to change the service file. Thanks!