Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am currently creating a daemon service and in order to leverage existing service functionality, the startup script sources from /etc/status.

This causes a problem with our service because within the first line, the locale is set to POSIX:

# Do _not_ be fooled by non POSIX locale
export LC_ALL

The problem is that the services which gets started from the script inherit this locale setting. The simple fix around this would be to unset the locale prior to starting the child process. However, I do not know the implications of this. What are the consequences of re-setting the LC_ALL variable after sourcing from rc.status?

share|improve this question

Many system daemons behave oddly if they are invoked with a non-POSIX locale; in particular, they often don't handle UTF-8 collation, which ignores case and punctuation. Non-POSIX time formats can also result in logfiles that can't be parsed by standard tools, which generally expect a fixed time format. More rarely, LC_CTYPE can cause problems.

In general, if you need the system-wide locale setting in a daemon, you should get it from /etc/sysconfig/language after loading rc.status. (This is assuming some variety of SuSE, which seems safe given rc.status; if it's a BSD, I don't know where it's currently stored.) The variables will be the usual ones with RC_ prepended (e.g. RC_LC_ALL).

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.