perl: warning: Setting locale failed.

C

Cyberspace19

Hallo zusammen,

leider habe ich bei mir noch ein kleines Problem mit den Locales und Perl.
Auf meine vServer bekomme ich von Cron jedes mal eine Meldung sobald das Updatescript ausgeführt wird
Code:
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
        LANGUAGE = "de_DE",
        LC_ALL = (unset),
        LANG = "de_DE@UTF-8"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
/usr/bin/webalizer: /usr/lib/libdb-4.5.so: no version information available (required by /usr/bin/webalizer)
/usr/bin/webalizer: /usr/lib/libdb-4.5.so: no version information available (required by /usr/bin/webalizer)
Wenn ich dieses Script aber über SSH im Terminal ausführe bekomme ich diese Meldung nicht mehr. Die Locales habe ich auch schon mal neu generieren lassen und auch ein "dpkg-reconfigure locales" hat nichts gebracht.

Ausgabe von "locale"
Code:
LANG=de_DE.UTF-8
LANGUAGE=de_DE
LC_CTYPE="de_DE.UTF-8"
LC_NUMERIC="de_DE.UTF-8"
LC_TIME="de_DE.UTF-8"
LC_COLLATE="de_DE.UTF-8"
LC_MONETARY="de_DE.UTF-8"
LC_MESSAGES="de_DE.UTF-8"
LC_PAPER="de_DE.UTF-8"
LC_NAME="de_DE.UTF-8"
LC_ADDRESS="de_DE.UTF-8"
LC_TELEPHONE="de_DE.UTF-8"
LC_MEASUREMENT="de_DE.UTF-8"
LC_IDENTIFICATION="de_DE.UTF-8"
LC_ALL=

Ausgabe von "locale -a"
Code:
C
de_DE
de_DE@euro
de_DE.iso88591
de_DE.iso885915@euro
de_DE.utf8
deutsch
german
POSIX


Dinge, die ich im Internet gefunden habe, halfen mir leider nicht weiter. Ich bitte deshalb um Unterstützung. :hilfe2:

#Greetz & Danke!
Cyberspace19
 
Hallo
Das Problem ist, dass Scripte die als Cronjob laufen keine Loginshell haben. Die Locale wird aber meist nur in der userspezifischen Shell definiert (e.g. ~/.bashrc).
Die Fehlermeldung ist aber Harmlos, da Perl nur mitteilt, dass es zur standardlocale C wechselt.
Du kannst natürlich dem Script beim Start die Locale mit auf den Weg geben, oder an globaler Stelle definieren. e.g /etc/profile.

Gruß Wolfgang
 
Danke für die Antwort.
Leider finde ich bei mir nichts in meiner .bashrc, welches ich in die /etc/profile übernehmen könnte, damit dieses "Problem" wegfällt.

Hier mal meine .bashrc
Code:
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples

# If not running interactively, don't do anything
[ -z "$PS1" ] && return

# don't put duplicate lines in the history. See bash(1) for more options
export HISTCONTROL=ignoredups

# check the window size after each command and, if necessary,
# update the values of LINES and COLUMNS.
shopt -s checkwinsize

# make less more friendly for non-text input files, see lesspipe(1)
[ -x /usr/bin/lesspipe ] && eval "$(lesspipe)"

# set variable identifying the chroot you work in (used in the prompt below)
if [ -z "$debian_chroot" ] && [ -r /etc/debian_chroot ]; then
    debian_chroot=$(cat /etc/debian_chroot)
fi

# set a fancy prompt (non-color, unless we know we "want" color)
case "$TERM" in
xterm-color)
    PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
    ;;
*)
    PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
    ;;
esac

# Comment in the above and uncomment this below for a color prompt
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '

# If this is an xterm set the title to user@host:dir
case "$TERM" in
xterm*|rxvt*)
    PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME}: ${PWD/$HOME/~}\007"'
    ;;
*)
    ;;
esac

# Alias definitions.
# You may want to put all your additions into a separate file like
# ~/.bash_aliases, instead of adding them here directly.
# See /usr/share/doc/bash-doc/examples in the bash-doc package.


#if [ -f ~/.bash_aliases ]; then
#    . ~/.bash_aliases
#fi

# enable color support of ls and also add handy aliases
if [ "$TERM" != "dumb" ]; then
    eval "`dircolors -b`"
    alias ls='ls --color=auto'
    #alias dir='ls --color=auto --format=vertical'
    #alias vdir='ls --color=auto --format=long'
fi

# some more ls aliases
alias ll='ls -l'
alias la='ls -A'
alias l='ls -CF'

# enable programmable completion features (you don't need to enable
# this, if it's already enabled in /etc/bash.bashrc and /etc/profile
# sources /etc/bash.bashrc).
if [ -f /etc/bash_completion ]; then
    . /etc/bash_completion
fi
und hier mal die /etc/profile
Code:
# /etc/profile: system-wide .profile file for the Bourne shell (sh(1))
# and Bourne compatible shells (bash(1), ksh(1), ash(1), ...).

if [ "`id -u`" -eq 0 ]; then
  PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/bin/X11"
else
  PATH="/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/games"
fi

if [ "$PS1" ]; then
  if [ "$BASH" ]; then
    PS1='\u@\h:\w\$ '
  else
    if [ "`id -u`" -eq 0 ]; then
      PS1='# '
    else
      PS1='$ '
    fi
  fi
fi

export PATH

umask 022
In der /etc/environment habe ich folgendes bereits eingetragen:
Code:
LANGUAGE="de_DE"
LANG="de_DE@UTF-8"

Soll ich hier noch das LC_ALL="de_DE@UTF-8" setzen bzw. kannst du mir bitte die Einträge geben, welche ich in /etc/profile eintragen muss, damit diese Meldung nicht mehr erscheint?
Ich weiß, dass es dennoch funktioniert. Allerdings sollte Cron mir nur bei Problemen, bei denen ich eingreifen muss, eine Mail zusenden, was derzeit ja nicht der Fall ist. :(

#Greetz & Danke!
Cyberspace19
 

Ähnliche Themen

Deutsche Tastatur in Debian Wheezy einstellen

Gnome3 Regionseinstellung deutsch

Problem mit locale

Akonadi startet nicht mehr

dovecot und postfix Konfiguration Problem

Zurück
Oben