Posts: 1,869
Threads: 43
Joined: Mar 2020
Reputation:
85
I set the locale through the Pi Imager, haven't touched it in any other way. Probably something that manifests on locales other than US?
My 3A+ and Zero both default to 100M for the swap file, and that's a tiny bit too little on the 3A+
----------------
Robert
Posts: 13,395
Threads: 304
Joined: Mar 2018
Reputation:
543
I'll look into setting the default to 200MB.
Posts: 13,395
Threads: 304
Joined: Mar 2018
Reputation:
543
I set locale to Europe/London on a Pi 4B 4GB and was not able to repro the fail when enabling swap.
Here's the console log starting with a fresh 9.0.3
Code: # LOCALE
pi@moode9test:~ $ locale
LANG=en_US.UTF-8
LANGUAGE=
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
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=
# SERVICE STATUS (disabled)
pi@moode9test:~ $ systemctl status dphys-swapfile.service
○ dphys-swapfile.service - dphys-swapfile - set up, mount/unmount, and delete a swap file
Loaded: loaded (/lib/systemd/system/dphys-swapfile.service; disabled; preset: enabled)
Active: inactive (dead)
Docs: man:dphys-swapfile(8)
# ENABLE SERVICE
pi@moode9test:~ $ sudo systemctl enable dphys-swapfile.service
Synchronizing state of dphys-swapfile.service with SysV service script with /lib/systemd/systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install enable dphys-swapfile
Created symlink /etc/systemd/system/multi-user.target.wants/dphys-swapfile.service → /lib/systemd/system/dphys-swapfile.service.
# REBOOT
pi@moode9test:~ $ sudo reboot
# SERVICE STATUS (enabled)
pi@moode9test:~ $ systemctl status dphys-swapfile.service
● dphys-swapfile.service - dphys-swapfile - set up, mount/unmount, and delete a swap file
Loaded: loaded (/lib/systemd/system/dphys-swapfile.service; enabled; preset: enabled)
Active: active (exited) since Tue 2024-07-02 00:27:23 BST; 6min ago
Docs: man:dphys-swapfile(8)
Main PID: 485 (code=exited, status=0/SUCCESS)
CPU: 172ms
Jul 02 00:27:22 moode9test systemd[1]: Starting dphys-swapfile.service - dphys-swapfile - set up, mount/unmount, and delete a swap file...
Jul 02 00:27:23 moode9test dphys-swapfile[372]: want /var/swap=100MByte, generating swapfile ... of 100MBytes
Jul 02 00:27:23 moode9test systemd[1]: Finished dphys-swapfile.service - dphys-swapfile - set up, mount/unmount, and delete a swap file.
# SWAPFILE SIZE 100MB
pi@moode9test:~ $ free -m
total used free shared buff/cache available
Mem: 907 223 401 4 339 683
Swap: 99 0 99
pi@moode9test:~ $
Posts: 1,869
Threads: 43
Joined: Mar 2020
Reputation:
85
(07-01-2024, 11:39 PM)Tim Curtis Wrote: I set locale to Europe/London on a Pi 4B 4GB and was not able to repro the fail when enabling swap.
Here's the console log starting with a fresh 9.0.3
Code: # LOCALE
pi@moode9test:~ $ locale
LANG=en_US.UTF-8
LANGUAGE=
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
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=
# SERVICE STATUS (disabled)
pi@moode9test:~ $ systemctl status dphys-swapfile.service
○ dphys-swapfile.service - dphys-swapfile - set up, mount/unmount, and delete a swap file
Loaded: loaded (/lib/systemd/system/dphys-swapfile.service; disabled; preset: enabled)
Active: inactive (dead)
Docs: man:dphys-swapfile(8)
# ENABLE SERVICE
pi@moode9test:~ $ sudo systemctl enable dphys-swapfile.service
Synchronizing state of dphys-swapfile.service with SysV service script with /lib/systemd/systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install enable dphys-swapfile
Created symlink /etc/systemd/system/multi-user.target.wants/dphys-swapfile.service → /lib/systemd/system/dphys-swapfile.service.
# REBOOT
pi@moode9test:~ $ sudo reboot
# SERVICE STATUS (enabled)
pi@moode9test:~ $ systemctl status dphys-swapfile.service
● dphys-swapfile.service - dphys-swapfile - set up, mount/unmount, and delete a swap file
Loaded: loaded (/lib/systemd/system/dphys-swapfile.service; enabled; preset: enabled)
Active: active (exited) since Tue 2024-07-02 00:27:23 BST; 6min ago
Docs: man:dphys-swapfile(8)
Main PID: 485 (code=exited, status=0/SUCCESS)
CPU: 172ms
Jul 02 00:27:22 moode9test systemd[1]: Starting dphys-swapfile.service - dphys-swapfile - set up, mount/unmount, and delete a swap file...
Jul 02 00:27:23 moode9test dphys-swapfile[372]: want /var/swap=100MByte, generating swapfile ... of 100MBytes
Jul 02 00:27:23 moode9test systemd[1]: Finished dphys-swapfile.service - dphys-swapfile - set up, mount/unmount, and delete a swap file.
# SWAPFILE SIZE 100MB
pi@moode9test:~ $ free -m
total used free shared buff/cache available
Mem: 907 223 401 4 339 683
Swap: 99 0 99
pi@moode9test:~ $
I'm not sure the locale error matters much, the swap file was enabled and works regardless. However, I'm still confused by the locale settings. In your example, the locale command seems to returning an en_US prefix in all the values. However my 3A set to en_GB in the imager says this:
Code: master@prometheus:~ $ locale
locale: Cannot set LC_ALL to default locale: No such file or directory
LANG=en_US.UTF-8
LANGUAGE=
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC=en_GB.UTF-8
LC_TIME=en_GB.UTF-8
LC_COLLATE="en_US.UTF-8"
LC_MONETARY=en_GB.UTF-8
LC_MESSAGES="en_US.UTF-8"
LC_PAPER=en_GB.UTF-8
LC_NAME=en_GB.UTF-8
LC_ADDRESS=en_GB.UTF-8
LC_TELEPHONE=en_GB.UTF-8
LC_MEASUREMENT=en_GB.UTF-8
LC_IDENTIFICATION=en_GB.UTF-8
LC_ALL=
A mixture of en_US and en_GB, note the LC_ALL is blank and the error saying it can't be set. I compared a 4B+, and it looks the same.
I don't think it is causing any issues though. An opportunity for me to learn some stuff.
----------------
Robert
Posts: 13,395
Threads: 304
Joined: Mar 2018
Reputation:
543
Wow, I didn't even notice "en_US" :-0
I'll try that test again. Maybe its an Imager bug.
Posts: 6,010
Threads: 176
Joined: Apr 2018
Reputation:
234
Two countries separated by more than a common language, eh?
LC_ALL should be empty. For example, from the ArchWiki
Quote:LC_ALL is the only LC_* variable which cannot be set in locale.conf files: it is meant to be used only for testing or troubleshooting purposes, for example in /etc/profile
Don’t know, offhand, what is triggering the error response from locale.
Regards,
Kent
Posts: 13,395
Threads: 304
Joined: Mar 2018
Reputation:
543
Ok, the "locale" command returns the System locale settings which indicate the local language among other things. This can be set in raspi-config but since moode only supports local language = English UTF-8 it should be left as-is.
It looks like the Pi Imager firstrun.sh script does not set the System locale, it sets the timezone and keyboard layout, same as in moode System Config.
Test #2 looks ok.
Code: pi@moode9test:~ $ localectl status
System Locale: LANG=en_US.UTF-8
VC Keymap: (unset)
X11 Layout: gb
X11 Model: pc105
pi@moode9test:~ $ timedatectl
Local time: Tue 2024-07-02 12:52:07 BST
Universal time: Tue 2024-07-02 11:52:07 UTC
RTC time: n/a
Time zone: Europe/London (BST, +0100)
System clock synchronized: yes
NTP service: active
RTC in local TZ: no
I also tried changing locale and wifi country using raspi-config but was not able to repro @ the_bertrum mixed en_US/en_GB settings reported by the locale command. I get either all en_US or all en_GB.
Posts: 1,869
Threads: 43
Joined: Mar 2020
Reputation:
85
I've been away for a week or so, so haven't looked more at this. Your experiments are interesting, I certainly didn't do anything other than set the locale in the imager, and yet I get this mashup... I'll experiment with some clean systems to see if I can fathom what makes mine different.
----------------
Robert
|