Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure character encoding can be detected by tlog on Fedora and RHEL #8

Open
spbnick opened this issue Mar 21, 2017 · 10 comments
Open

Comments

@spbnick
Copy link
Member

spbnick commented Mar 21, 2017

At the moment, at least on Fedora, when logging in via login on console or with su, tlog is supplied with ASCII as the character encoding to use and aborts (because it only supports UTF-8). At the same time ASCII is not the actual character encoding to use, and the configured encoding is in fact UTF-8. This is due to Fedora (at least) setting it in /etc/locale.conf, to be sourced by shells when they read startup files.

This ad-hoc solution is leaving other programs, which are not prepared to interpret shell language (or even just the limited language of /etc/locale.conf) in the cold. Instead something like the Debian approach should be used. Debian sets locale using pam_env, which works for any program.

Find a way to read Fedora (and RHEL) locale settings in tlog, and/or change the way the distributions do it.

@spbnick spbnick added this to the Stage A milestone Mar 21, 2017
@spbnick
Copy link
Member Author

spbnick commented Mar 21, 2017

See also Scribery/tlog#78.

@spbnick
Copy link
Member Author

spbnick commented Mar 21, 2017

A (rather burdensome) workaround can be for user to set up pam_env themselves.

@spbnick
Copy link
Member Author

spbnick commented Mar 29, 2017

The pam_env workaround can be putting this into /etc/pam.d/system-auth:

session     required      pam_env.so readenv=1 envfile=/etc/locale.conf

Putting it before this line seems to work:

session     required      pam_limits.so

@spbnick
Copy link
Member Author

spbnick commented Apr 4, 2017

@spbnick
Copy link
Member Author

spbnick commented May 22, 2017

There was no response to the message on Fedora devel maillist.

@spbnick
Copy link
Member Author

spbnick commented May 22, 2017

Getting in touch with PAM maintainers next.

@spbnick
Copy link
Member Author

spbnick commented May 22, 2017

Tomas Mraz, the PAM and authconfig maintainer in Fedora seems to be fine with the PAM-based fix as long as the format of /etc/locale.conf is within what pam_env.so expects. I raised systemd-devel to check, and run the whole idea past them.

@spbnick
Copy link
Member Author

spbnick commented May 22, 2017

Another approach could be letting the systemd and login pass the locale environment variables read and set by systemd-logind.

First these lines need to be removed from the /lib/systemd/system/getty@.service file:

# Unset locale for the console getty since the console has problems
# displaying some internationalized messages.
Environment=LANG= LANGUAGE= LC_CTYPE= LC_NUMERIC= LC_TIME= LC_COLLATE= LC_MONETARY= LC_MESSAGES= LC_PAPER= LC_NAME= LC_ADDRESS= LC_TELEPHONE= LC_MEASUREMENT= LC_IDENTIFICATION=

And the following line in the same file:

ExecStart=-/sbin/agetty --noclear %I $TERM

needs to be changed to this:

ExecStart=-/sbin/agetty -o "-p -- \u" --noclear %I $TERM

@spbnick
Copy link
Member Author

spbnick commented May 24, 2017

A fix for the above was submitted to systemd: systemd/systemd#6023

@spbnick
Copy link
Member Author

spbnick commented May 30, 2017

Discussion with systemd upstream is still ongoing, but we have the fallback path of the PAM configuration.

@spbnick spbnick modified the milestones: Stage A, ENTERPRISEv1 Oct 12, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant