Bugzilla – Bug 105322
/etc/init.d/network: touch `date`: Problem if LANG != "C"
Last modified: 2006-02-27 17:44:18 UTC
I did an installation in German and saw during startup a message like like that: touch: Ungültiges Datumsformat „Mi Aug 17 22:34:26 CEST 2005“ In /etc/init.d/network you find: touch -d "`date -d "-20sec"`" $NETWORK_RUNFILE and touch does not accept a German time format tob2@tux:~> touch -d "`date -d "-20sec"`" test touch: Ungültiges Datumsformat „Mi Aug 17 22:34:26 CEST 2005“ tob2@tux:~> LANG=C touch -d "`date -d "-20sec"`" test touch: invalid date format `Mi Aug 17 22:34:32 CEST 2005' I don't know whether TOUCH should understand the date format of the current locale or not, but doing a LC_ALL=C should not hurt: LC_ALL=C touch -d "`LC_ALL=C date -d "-20sec"`" $NETWORK_RUNFILE
fixed
Gerald Carter, member of the Samba Team asked: Why does SuSE set these lines in /etc/rc.status # Do _not_ be fooled by non POSIX locale LC_ALL=POSIX xport LC_ALL We're having some problems with is resulting in smbd not running with a UTF-8 charset and is breaking creating printers with extended characters in the name.
Werner or Mike: Should we get LANG from /etc/sysconfig/language and export it before we start smbd and unset it after?
This depends on the requirement of the samba people. If you need this than do this. The allmost other boot scripts do require POSIX for LANG.
Lars> Should we get LANG from /etc/sysconfig/language and export it Lars> before we start smbd In the /etc/init.d/kbd script, I used: test -e /etc/profile.d/lang.sh && . /etc/profile.d/lang.sh LOCALE_CHARMAP=`locale charmap` LC_ALL=POSIX This will work only if ROOT_USES_LANG="ctype" or "yes". If ROOT_USES_LANG="no", it will not work because then . /etc/profile.d/lang.sh will not even set LC_CTYPE. According to comment #2 it looks like you need only the charmap of the locale, i.e. sourcing /etc/profile.d/lang.sh should be enough unless somebody sets ROOT_USES_LANG="no" If ROOT_USES_LANG="yes", sourcing /etc/profile/lang.sh will give you the same locale as for regular (non-root) users. If you don't want to depend on the setting of ROOT_USES_LANG you have to source /etc/sysconfig/language and use at the values of RC_*. For example: . /etc/sysconfig/language export LANG=$RC_LANG export LC_ALL=$RC_LC_ALL export LC_MESSAGES=$RC_LC_MESSAGES ... do something which needs correct locale settings unset LANG unset LC_ALL unset LC_MESSAGES ... Lars> and unset it after? This depends on what you do in the smbd start script. Are you parsing any output which might break if it comes in a different language? Do you depend on a certain sorting order when parsing output? If you do such stuff, better use LC_ALL=POSIX to make sure that your parser doesn't break. If not, it doesn't matter.
Fixed with next Samba package. And thanks Werner and Mike.