ArchThis Forum is for the discussion of Arch Linux.
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
I need to run SBCL in a UTF-8 environment in a VM running Arch. When I log in as the dedicated user and run the start script, it runs in UTF-8 and works fine. However I need to start it through a (bash) script, and when I run it with:
su - user -c /var/lib/.../start-script
it runs in an environment with all language variables set to POSIX, which causes errors.
I have set LOCALE to en_US.UTF-8 in rc.conf and checked locale.gen, and both the root and the user use this normally. Running locale as root shows all variables set properly to en_US.UTF-8.
Yet when I do su - user -c locale, it's all set to POSIX.
How is this possible, who is this user su runs as, what should I do?
EDIT: It works if I do:
su - user -c export LANG=en_US.UTF-8 && /var/lib/.../start-script
I don't understand why this is required.
EDIT: I read about some update late last year, which made /etc/profile.d/locale.sh obsolete (?) and made /etc/locale.conf take precedence over /etc/rc.conf. Following those instructions isn't working for me though. Moving locale.sh and using /etc/locale.conf sets all vars to POSIX for all users; if I keep it it's still the same as I originally described.
So omitting the hyphen makes it use the root's environment? It might kind of work since root does use unicode, but optimally I *want* su to load that user's environment, and that's not what it does with "su -". The user also has all locale variables set to unicode.
What I want to do is to run the process as that user, in that user's environment, from a bash script at boot time.