Contenu | Rechercher | Menus

Annonce

Si vous rencontrez des soucis à rester connecté sur le forum (ou si vous avez perdu votre mot de passe) déconnectez-vous et reconnectez-vous depuis cette page, en cochant la case "Me connecter automatiquement lors de mes prochaines visites". Attention, le forum rencontre actuellement quelques difficultés. En cas d'erreur 502, il ne faut pas re-valider l'envoi d'un message ou l'ouverture d'une discussion, au risque de créer un doublon.

La section divers se réorganise ! De nouvelles sous-sections à venir. (plus d'infos + donner son avis)

#1 Le 11/06/2013, à 20:21

Nathaly01

Que fait exactement ce script ?

Bonsoir,

Je connais rien en programmation, mais j'ai un problème de langue des menus sur Ubuntu 12.04 suite à l'installation de pbis-open.

Voir plus d'explications ici : http://forum.ubuntu-fr.org/viewtopic.php?id=1301871

J'ai remarquée ce script qui pourrait être, (mais j'en sait fistre rien !! lol) à l'origine de mes problèmes.

Alors si quelqu'un comprend ce qu'il fait, et déjà en quel langage il est, ce serait trop sympa de me l'expliquer, lol, pratiquement ligne par ligne ...

#! /bin/sh
#
# Copyright (c) BeyondTrust Software.  All rights reserved.
#
### BEGIN INIT INFO
# Provides: lwsmd
# Required-Start:
# Required-Stop:
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Description: Start and Stop PBIS Service Manager
### END INIT INFO

PROG_DESC="PBIS Service Manager"
PROG_BIN=/opt/pbis/sbin/lwsmd
PROG_ARGS="--start-as-daemon"
PIDFILE=
SCRIPTNAME="lwsmd"
STARTHOOK="fix_locale"

lookup_user_locale()
{
    . /etc/sysconfig/language
    printf 'LANG=%q; export LANG\n' "$RC_LANG"
    printf 'LC_ALL=%q; export LC_ALL\n' "$RC_LC_ALL"
    printf 'LC_CTYPE=%q; export LC_CTYPE\n' "$RC_LC_CTYPE"
}

fix_locale()
{
    if [ "$LC_ALL" = "POSIX" ]
    then
        unset LC_ALL
        export LC_ALL
    fi
    if type locale >/dev/null &&
        locale | grep LC_CTYPE | grep POSIX >/dev/null; then
        if [ -f /etc/sysconfig/language ]; then
            eval "`lookup_user_locale`"
        elif [ -f /etc/default/locale ]; then
            . /etc/default/locale
            export LANG
        fi
    elif [ -z "$LANG" ]; then
        LANG="en_US.UTF-8"
        export LANG
    fi
}

. /opt/pbis/libexec/init-base.sh

Merci d'avance à ceux qui pourront m'aider, ce serait trop bête que ma famille veuille revenir à windows juste à cause d'un problème de langue de l'OS surtout qu'ils adorent Ubuntu ..... en Français !!!! lol
Et si vous pensez que c'est à l'origine de mes soucis, si vous avez une suggestion pour le modifier, même d'une manière radicale pour imposer le "fr-FR.UTF-8" (j'ai des PC partout dans la maison mais pas 250, donc je prendrais le temps de le faire), je suis preneuse ...
Cordialement,

Dernière modification par Nathaly01 (Le 11/06/2013, à 20:32)

Hors ligne

#2 Le 11/06/2013, à 20:58

Anonyme68

Re : Que fait exactement ce script ?

Bonjour,

Nathaly01 a écrit :

et déjà en quel langage il est

C'est un script en sh (le même langage que dans la console)

Nathaly01 a écrit :

ce serait trop sympa de me l'expliquer, lol, pratiquement ligne par ligne ...

je vais pas t'expliquer ligne par ligne

mais grosso modo :
les lignes qui commence par # sont des commentaires, elle ne servent à rien pendant l’exécution du script



cette partie définie les variables la variable est avant le égal et le contenu après
PROG_DESC="PBIS Service Manager"
....
STARTHOOK="fix_locale"



les commandes entres les 2 parenthèses sont appelées par le script elles ne sont pas exécutées directement
lookup_user_locale()
{
....
}

fix_locale()
{
....
}


Donc la seule chose que fait ton script est l’exécution d'un autre script qui s'appelle /opt/pbis/libexec/init-base.sh

... on est bien avancé, peut-être l'examen de ce script permet d'en savoir d'avantage.

Je suppose que les moyens standards pour changer la langue ne fonctionnent pas

Cordialement

Dernière modification par Anonyme68 (Le 11/06/2013, à 21:01)


Mon profil Steam

Hors ligne

#3 Le 11/06/2013, à 21:09

Nathaly01

Re : Que fait exactement ce script ?

Super sympa de ta réponse super rapide !!!!
Tu pense que ça a voir avec mon problème de langue ???
A tout hazard, je te donne le script que ça appelle !!!

#!/bin/sh

# Generic cross-platform init script logic
# Copyright (c) Likewise Software, Inc.
# All rights reserved.
#
# Authors: Jerry Carter (gcarter@likewisesoftware.com)
#          Kyle Stemen (kstemen@likewisesoftware.com)
#          Brian Koropoff (bkoropoff@likewisesoftware.com)

# Implict arguments to this script when sourced:
#
# PROG_DESC - English description of program/service
# PROG_BIN - path to the program binary
# PROG_ARGS - additional arguments to pass to program on startup
# PROG_ERR - file where error diagnostics are logged
# PIDFILE - file where pid is stored (or empty/unset if a pid file is not created)
# SCRIPTNAME - the name of the init script

## Have to set the path for HP-UX boot process
PATH=/sbin:/usr/sbin:/bin:/usr/bin:$PATH
export PATH

alias_replacement()
{
    # Simulates the alias builtin function. It does this by creating a function
    # with the name of what should be aliased. So if it was run like this:
    #   alias_replacement myecho='echo my'
    # Then the alias would be emulated like this:
    #   myecho()
    #   {
    #      echo my "$@"
    #   }
    if [ "$#" -ne 1 ]; then
        echo "alias takes 1 argument"
        return 1
    fi
    # This function is passed something like abc=xyz . The name variable gets
    # set to abc, and value gets set to xyz .
    name="`expr "$1" : '^\(.*\)='`"
    value="`expr "$1" : '.*=\(.*\)$'`"
    eval "$name() { $value \"\$@\"; }"
}

alias aliastest=echo
type aliastest 1>/dev/null 2>/dev/null
alias_works=$?

_test_alias() { false; }
alias _test_alias="true"
case a in a) _test_alias; alias_case_works=$?;; esac
eval '_test_alias >/dev/null 2>&1'
alias_eval_works=$?

if [ $alias_works -ne 0 -o $alias_case_works -ne 0 ]
then
    ( alias() { true; } ) >/dev/null 2>&1
    can_overwrite_builtins=$?
    unset alias >/dev/null 2>&1

    if [ $alias_eval_works -eq 0 -a $can_overwrite_builtins -ne 0 ]; then
        # This is HP-UX. The alias command only takes effect when the file
        # is read. Furthermore, HP-UX won't let us redefine shell
        # builtins as system functions. So we'll have to alias
        # whatever shell builtins we need to now, and reread the file. The
        # alias_replacement function can realias the shell builtins after
        # they are renamed.
        echo_rename()
        {
            echo "$@"
        }
        alias echo=echo_rename
        alias alias=alias_replacement
        # It would cause problems if these aliases are left around for
        # when this script is resourced.
        unalias _test_alias
        unalias aliastest
        # Resource this script
        . /opt/pbis/libexec/init-base.sh
        exit $?
    fi

    # This platform doesn't have a working alias (at all). It needs to be
    # replaced. This is primarily for Solaris and FreeBSD.
    alias()
    {
        alias_replacement "$@"
    }
fi


##
## Determine what platform we are on
##
PLATFORM=""
if [ -f /etc/init.d/functions ]; then
    . /etc/init.d/functions
    PLATFORM="REDHAT"
elif [ -f /etc/rc.status ]; then
    . /etc/rc.status
    PLATFORM="SUSE"
elif [ -f /etc/debian_version ]; then
    . /lib/lsb/init-functions
    PLATFORM="DEBIAN"
elif [ "`uname -s`" = 'AIX' ]; then
    PLATFORM="AIX"
elif [ "`uname -s`" = 'HP-UX' ]; then
    PLATFORM="HP-UX"
elif [ "`uname -s`" = 'SunOS' ]; then
    PLATFORM="SOLARIS"
elif [ "`uname -s`" = 'VMkernel' ]; then                                  
    PLATFORM="ESXI"                             
elif [ "`uname`" = "FreeBSD" -o "`uname`" = "Isilon OneFS" ]; then
    PLATFORM="FREEBSD"
    extra_commands="reload"
    reload_cmd=daemon_reload
    status_cmd=daemon_status
    start_cmd=daemon_start
    stop_cmd=daemon_stop
else
    PLATFORM="UNKNOWN"
fi

if [ -f /etc/rc.subr ]; then
    . /etc/rc.subr
fi

if [ $PLATFORM = "HP-UX" -o $PLATFORM = "SOLARIS" -o $PLATFORM = "FREEBSD" ]; then
    LOCKFILE="/var/run/${SCRIPTNAME}.lock"
else
    LOCKFILE="/var/lock/subsys/${SCRIPTNAME}"
fi

type printf 1>/dev/null 2>/dev/null
if [ $? -ne 0 ]; then
    # Usually printf is a shell built in, but on HPUX it is a program located
    # at /bin/printf. During system startup and shutdown the path is only
    # /sbin, so we need to manually find printf
    if [ -x /bin/printf ]; then
        alias printf=/bin/printf
    else
        echo "WARNING: unable to find printf program"
    fi
fi

# echo_replacement emulates echo for all platforms using printf. printf is a
# shell builtin that exists on all platforms.
echo_replacement()
{
    if [ "$1" = "-n" ]; then
        shift;
        printf %s "$*"
    else
        printf %s\\n "$*"
    fi
}

# 'echo -n' works with bash, but not with sh on Solaris, HPUX, and AIX.
if [ "`echo -n`" = "-n" ]; then
    alias echo=echo_replacement
fi

seq_replacement()
{
    FIRST=1
    INCREMENT=1
    case "$#" in
        0)
            echo too few arguments
            return 1
            ;;
        1)
            LAST="$1"
            ;;
        2)
            FIRST="$1"
            LAST="$2"
            ;;
        3)
            FIRST="$1"
            INCREMENT="$2"
            LAST="$3"
            ;;
        *)
            echo too many arguments
            return 1
            ;;
    esac
    i="$FIRST"
    while [ "$i" -le "$LAST" ]; do
        echo "$i"
        i="`expr "$i" + "$INCREMENT"`"
    done
    return 0;
}

# seq doesn't exist on HPUX or FreeBSD
type seq 2>/dev/null 1>/dev/null
if [ $? -ne 0 ]; then
    alias seq=seq_replacement
fi

##
## small wrapper functions around distro specific calls
##

status_success() {
    case "${PLATFORM}" in 
        REDHAT)
            echo_success
            echo
            ;;
        SUSE)
            rc_reset
            rc_status -v
            ;;
        DEBIAN)
            ;;
        AIX | HP-UX | SOLARIS | FREEBSD | ESXI | UNKNOWN)
            echo "...ok"
            ;;
    esac
}

status_failed() {
    status=$1
    case "${PLATFORM}" in 
        REDHAT)
            echo_failure
            echo
            ;;
        SUSE)
            rc_failed $status
            rc_status -v
            ;;
        DEBIAN)
            ;;
        AIX | HP-UX | SOLARIS | ESXI | UNKNOWN)
            echo "...failed"
            ;;
    esac
}

print_status () {
    status=$1

    if [ $status = 0 ]; then
        status_success
    else
        status_failed $status
    fi
}

generic_status()
{
    #Uses return codes specified in
    # http://refspecs.freestandards.org/LSB_3.1.0/LSB-Core-generic/LSB-Core-generic/iniscrptact.html
    pids="`generic_pid`"
    #Take the list of pids and get just the last one
    pid=""
    for i in $pids; do
        pid="$i"
    done

    if [ -n "$pid" ]
    then
        #Is the pid valid?
        #Does the program with that pid match our program name?
        #HP-UX needs UNIX95 set to support the -o option
        if [ "${PLATFORM}" = "ESXI" ]; then
            if kill -0 $pid > /dev/null 2>&1 ; then
                # pid is valid. have to assume it's the right program
                return 0
            else
                return 1
            fi
        fi
        pid_comm="`UNIX95=1 ps -p "$pid" -o args= 2>/dev/null | awk '{print $1}'`"
        if [ "$pid_comm" = "<defunct>" ]; then
            #It is a zombie process
            return 4
        fi
        if [ "$pid_comm" = "${PROG_BIN}" ]; then
            #If the system keeps cmdline files, check it
            if [ -f /proc/${pid}/cmdline ]; then
                #We can't check the exe file because we may be looking
                #at a version of the program that has been overwritten
                grep -q ${PROG_BIN} /proc/${pid}/cmdline && return 0
            else
                return 0
            fi
        fi

        #Program is dead, but lock file exists
        [ -f "${LOCKFILE}" ] && return 2
        
        #Program is dead, but pid file exists
        return 1
    else
        return 3
    fi
}

generic_pid()
{
    if [ -n "${PIDFILE}" -a -f "${PIDFILE}" ]
    then
        cat "${PIDFILE}"
    else
        case "${PLATFORM}" in
            FREEBSD)
                pgrep -f "^${PROG_BIN}"
                ;;
            ESXI)
                ( ps | grep "^[0-9]* [0-9]* `basename ${PROG_BIN}` *${PROG_BIN}" | awk '{ print $1 };' | head -1 )
                ;;
            HP-UX)
                ( UNIX95= ps -e -o pid= -o args= | grep "^ *[0123456789]* *${PROG_BIN}" | awk '{ print $1 };' )
                ;;
            *)
                ( UNIX95=1; ps -e -o pid= -o args= | grep "^ *[0123456789]* *${PROG_BIN}" | awk '{ print $1 };' )
                ;;
        esac
    fi
}

check_load_path()
{
    libdir=/opt/pbis/lib
    if [ -x /opt/pbis/lib64 ]; then
        libdir=/opt/pbis/lib64
    fi
    for name in LD_LIBRARY_PATH LIBPATH SHLIB_PATH; do
        eval value=\$$name
        if [ -n "$value" ]; then
            expr "$value" : "^$libdir:" >/dev/null
            if [ $? -ne 0 ]; then
                if type logger >/dev/null 2>&1; then
                    logger -p daemon.error "LD_LIBRARY_PATH, LIBPATH, and SHLIB_PATH must be unset or list $libdir as the first directory. Likewise daemons will automatically unset the variable, but this variable still must be changed for the rest of your system. See the \"Requirements for the Agent\" section of the Likewise manual for more information."
                fi
                unset $name
                export $name
            fi
        fi
    done
    if [ -n "$LD_PRELOAD" ]; then
        if type logger >/dev/null 2>&1; then
            logger -p daemon.error "LD_PRELOAD must be unset. Likewise daemons will automatically unset the variable, but this variable still must be changed for the rest of your system. See the \"Requirements for the Agent\" section of the Likewise manual for more information."
        fi
        unset LD_PRELOAD
        export LD_PRELOAD
    fi
}

daemon_start() {

    if [ -f "${PROG_ERR}" ]; then
        /bin/rm -f $PROG_ERR;
    fi

    if [ -n "${STARTHOOK}" ]; then
        ${STARTHOOK}
    fi

    check_load_path

    case "${PLATFORM}" in 
        REDHAT)
            echo -n $"Starting `basename ${PROG_BIN}`: "
            daemon ${PROG_BIN} ${PROG_ARGS}
            status=$?
            ;;
        SUSE)
            echo -n "Starting $PROG_DESC"
            startproc ${PROG_BIN} ${PROG_ARGS}
            status=$?
            ;;
        DEBIAN)
            log_daemon_msg "Starting $PROG_DESC: `basename $PROG_BIN`"
            start-stop-daemon --start --exec ${PROG_BIN} -- ${PROG_ARGS}
            status=$?
            log_end_msg $status
            ;;
        AIX)
            echo -n "Starting $PROG_DESC"
            if (lssrc -s dhcpcd | grep active >/dev/null); then
                # Wait up to 30 seconds for an ip address
                for i in `seq 30`; do
                    ifconfig -a | grep inet | grep -v 127.0.0 | grep -v 0.0.0.0 | grep -v ::1/0 >/dev/null && break
                    sleep 1
                done
            fi
            ${PROG_BIN} ${PROG_ARGS}
            status=$?
            if [ $status -eq 0 ]; then
                status=1
                for i in `seq 5`; do
                    #Did the program start?
                    generic_status
                    status=$?
                    [ $status -eq 0 ] && break
                    sleep 1
                done
            fi
            ;;
        HP-UX | SOLARIS | FREEBSD | ESXI)
            echo -n "Starting $PROG_DESC"
            if type svcadm >/dev/null 2>&1 ; then
                # Use the solaris service manager

                # This will start the program again if it was in maintenance
                # mode.
                svcadm clear "$SCRIPTNAME" 2>/dev/null
                # This will start the program again if it was disabled.
                svcadm enable "$SCRIPTNAME"
                status=$?
            else
                ${PROG_BIN} ${PROG_ARGS}
                status=$?
            fi
            if [ $status -eq 0 ]; then
                status=1
                for i in `seq 5`; do
                    #Did the program start?
                    generic_status
                    status=$?
                    [ $status -eq 0 ] && break
                    sleep 1
                done
            fi
            ;;
        UNKNOWN)
            ${PROG_BIN} ${PROG_ARGS}
            status=$?
            ;;
    esac

    if [ -n "${POSTSTARTHOOK}" ]; then
        ${POSTSTARTHOOK}
    fi

    [ $status = 0 ] && [ ${PLATFORM} != "DEBIAN" ] && touch ${LOCKFILE}
    return $status
}

daemon_stop() {
    case "${PLATFORM}" in 
        DEBIAN)
            log_daemon_msg "Stopping $PROG_DESC: `basename $PROG_BIN`"
            status=1
            #only try to stop the daemon if it is running
            if generic_status; then
                kill -TERM "`generic_pid`"
                # Forget our pidfile since it will now be invalid
                # if is still present.  This means generic_status
                # will fall back on ps to see if the daemon is still
                # running.  This is important on LinuxThreads-based
                # systems where other threads can still be in the process
                # of shutting down even when the main thread has exited
                PIDFILE=""
                #Wait up to 180 seconds for the program to end
                for i in `seq 180`; do
                    #Did the program end?
                    generic_status
                    # Make sure the agent is not running and is not a zombie
                    # process.
                    [ $? -ne 0 -a $? -ne 4 ] && status=0 && break
                    # use the following line instead after bug 3634 is fixed
                    #[ $? -eq 3 -o $? -eq 2 ] && status=0 && break
                    sleep 1
                done
            fi
            log_end_msg $status
            ;;
        REDHAT | SUSE | AIX | HP-UX | SOLARIS | FREEBSD | ESXI)
            echo -n "Stopping $PROG_DESC"
            status=1
            #only try to stop the daemon if it is running
            if type svcadm >/dev/null 2>&1 && generic_status; then
                # Use the solaris service manager
                svcadm disable "$SCRIPTNAME"

                #Wait up to 180 seconds for the program to end
                for i in `seq 180`; do
                    #Did the program end?
                    generic_status
                    # Make sure the agent is not running and is not a zombie
                    # process.
                    [ $? -ne 0 -a $? -ne 4 ] && status=0 && break
                    # use the following line instead after bug 3634 is fixed
                    #[ $? -eq 3 -o $? -eq 2 ] && status=0 && break
                    sleep 1
                done
            fi
            if generic_status; then
                # svcadm does not exist, or it was unable to stop the program
                pid="`generic_pid`"
                kill -TERM $pid

                #Wait up to 180 seconds for the program to end
                for i in `seq 180`; do
                    #Did the program end?
                    generic_status
                    # Make sure the agent is not running and is not a zombie
                    # process.
                    [ $? -ne 0 -a $? -ne 4 ] && status=0 && break
                    # use the following line instead after bug 3634 is fixed
                    #[ $? -eq 3 -o $? -eq 2 ] && status=0 && break
                    sleep 1
                done
            fi
            ;;
        UNKNOWN)
            killall -TERM `basename ${PROG_BIN}`
            status=$?
            ;;
    esac

    [ $status = 0 ] && /bin/rm -f ${LOCKFILE}
    return $status
}

daemon_reload()
{
    case "${PLATFORM}" in 
        REDHAT | SUSE | FREEBSD | ESXI)
            echo -n $"Reloading ${PROG_DESC} configuration"
	    killall -HUP "`basename ${PROG_BIN}`"
            status=$?
            ;;
        DEBIAN)
            log_daemon_msg "Reloading $PROG_DESC configuration"
	    killall -HUP "`basename ${PROG_BIN}`"
	    status=$?
            log_end_msg $status
            ;;
        AIX | HP-UX | SOLARIS | UNKNOWN)
            echo -n "Stopping $PROG_DESC"
	    generic_killall -HUP
	    status=$?
            ;;
    esac

    return $status
}

daemon_status() {
    case "${PLATFORM}" in
        REDHAT)
            status ${PROG_BIN}
            ;;
        SUSE)
            checkproc ${PROG_BIN}
            rc_status -v
            ;;
        AIX | HP-UX | SOLARIS | DEBIAN | FREEBSD | ESXI)
            generic_status
            status=$?
            case "$status" in
                0)
                    echo "running";
                    ;;
                1)
                    echo "stopped";
                    #Use the bellow line instead after bug 3634 is fixed
                    #echo "died leaving pid file";
                    ;;
                2)
                    echo "died leaving lock file";
                    ;;
                3)
                    echo "stopped";
                    ;;
            esac
            return $status
        ;;
        UNKNOWN)
            echo "Not implemented."
            ;;
    esac
}

#Sends the signal specified by the first parameter to all instances
#of $PROG_BIN
generic_killall()
{
    #This gets the list of all current running instances of PROG_BIN,
    #but it can't tell which directory the program was run from. If
    #cmdline is available in the proc pseudo-filesystem, we'll verify
    #the pids.
    unverified_pids=`generic_pid`
    pids=
    for pid in $unverified_pids; do
        #If the system keeps cmdline files, check them
        if [ -f /proc/${pid}/cmdline ]; then
            #We can't check the exe file because we may be looking
            #at a version of the program that has been overwritten
            grep -q ${AUTHD_BIN} /proc/${pid}/cmdline && pids="$pids $pid"
        else
            pids="$pids $pid"
        fi
    done

    for pid in $pids; do
        [ ! -z "`UNIX95=1 ps -p $pid -o pid=`" ] && kill "$1" $pid
    done

    #The manpage of killall says it returns 0 if at least one process is
    #killed. I can't get it to return anything other than 0. Even if no
    #processes die with SIGTERM. We'll just return 0 here too
    return 0
}

####################################################################
## Main init script code
##

if type run_rc_command >/dev/null 2>&1; then
    # Looks like this is a FreeBSD based system. We should use their arg
    # parsing instead of our own.
    name="$SCRIPTNAME"
    rcvar="`set_rcvar`"
    command="$PROG_BIN"
    command_args="$PROG_ARGS"
    pidfile="$PIDFILE"
    eval "${name}_enable=YES"

    load_rc_config "$name"
    [ "$1" = "start" -a -n "${STARTHOOK}" ] && ${STARTHOOK}
    check_load_path
    run_rc_command "$1" || exit $?
    [ "$1" = "start" -a -n "${POSTSTARTHOOK}" ] && ${POSTSTARTHOOK}
    exit 0
fi

case "$1" in 
    start)
        daemon_start
        ret=$?
        print_status $ret
        ;;

    stop)
        daemon_stop
        ret=$?
        print_status $ret
        ;;

    # HP-UX calls this
    stop_msg)
        echo "Stopping $PROG_DESC"
        exit 0
        ;;

    # HP-UX calls this
    start_msg)
        echo "Starting $PROG_DESC"
        exit 0
        ;;

    restart)
        daemon_stop
        ret=$?
        print_status $ret
        daemon_start
        ret=$?
        print_status $ret
        ;;
        
    status)
        daemon_status
        ;;

    reload)
	# Ignore SIGHUP since killall could send it to us as well
	trap '' HUP
	daemon_reload
	ret=$?
	print_status $ret
        ;;
    *)
        echo "Usage: $0 {start|stop|restart|status|reload}"
        exit 1
        ;;
esac

voili voilou !!!
Heuuu, il y a un tuto, enfin quelque chose pour apprendre ce langage, comme ça, j'éviterais de venir vous déranger (sauf si je bug !!!) ???
De toute manière, je pense que ce me sera utile dans l'avenir !!!!

Merci à toi Anonyme68 !!!

Hors ligne

#4 Le 11/06/2013, à 21:24

Nathaly01

Re : Que fait exactement ce script ?

En effet, "prise en charge des langues" ne fonctionne pas, choix de la langue avant le login et pasword n'est pas prit en compte, forcer sur un terminal avec LC_ALL="fr_FR.UTF-8" et redemarrage de la session ne marche pas ....
Je sais plus quoi faire sous 12.04 alors que sous 10.04, les sessions AD ouverte grâce à pbis-open sont en Français comme je le dis sur : http://forum.ubuntu-fr.org/viewtopic.php?id=1301871

Hors ligne

#5 Le 11/06/2013, à 22:02

Anonyme68

Re : Que fait exactement ce script ?

Tu peux me donner les contenus des fichiers suivants :

/etc/sysconfig/language   
/etc/default/locale

la seule référence à la langue anglaise que j'ai trouvé (dans le premier script) :

        LANG="en_US.UTF-8"

en modifiant ça directement dans le script peut-être ?


Mon profil Steam

Hors ligne

#6 Le 11/06/2013, à 22:24

Nathaly01

Re : Que fait exactement ce script ?

Alors pour :  /etc/sysconfig/language   que ce soit sous 12.04 comme sous 10.04, manifestement, ce repertoire (/sysconfig) n'existe pas, même après "ctrl+H" pour voir les fichier cacher.
Pour /etc/default/locale :

LANG="fr_FR.UTF-8"
LANGUAGE="fr:en"
LC_NUMERIC="fr_FR.UTF-8"
LC_TIME="fr_FR.UTF-8"
LC_MONETARY="fr_FR.UTF-8"
LC_PAPER="fr_FR.UTF-8"
LC_IDENTIFICATION="fr_FR.UTF-8"
LC_NAME="fr_FR.UTF-8"
LC_ADDRESS="fr_FR.UTF-8"
LC_TELEPHONE="fr_FR.UTF-8"
LC_MEASUREMENT="fr_FR.UTF-8"

Sniff, c'est ce que je veux voir en faisant "locale" sur une console "terminal" mais a chaque fois, j'ai "posix" à la place de "fr_FR.UTF-8".
Je suppose que "posix" représente la langue par default de Ubuntu, autrement dit, "en-US.UTF-8" ???
Déjà, leur faire abandonner leur sacro saint "Windows seven" a été un sacré tour de passe-passe de ma part, mais lui faire apprendre l'anglais à plus de 45 ans, j'y arriverais pas, faut que je trouve avec votre aide que son ordi lui parle en Français !!!! lol Pour les enfants, ils sont encore jeunes mais sa leurs fait pas de mal d'apprendre !!!

Hors ligne

#7 Le 11/06/2013, à 23:06

Anonyme68

Re : Que fait exactement ce script ?

La seule partie qui va définir la langue est celle-là :

Si LC_ALL = POSIX, alors vide LC_ALL
if [ "$LC_ALL" = "POSIX" ]
    then
        unset LC_ALL
        export LC_ALL
    fi

Si la commande locale existe et que LC_CTYPE contient POSIX
    if type locale >/dev/null &&
        locale | grep LC_CTYPE | grep POSIX >/dev/null; then

si le fichier /etc/sysconfig/language existe (pas ton cas)
        if [ -f /etc/sysconfig/language ]; then
            eval "`lookup_user_locale`"

si le fichier /etc/default/locale exite (ton cas), alors lit le /etc/defaut/locale
        elif [ -f /etc/default/locale ]; then
            . /etc/default/locale
            export LANG
        fi

si le LANG est nul alors défini l'anglais (a priori pas utilisé car le premier if est utilisé)
    elif [ -z "$LANG" ]; then
        LANG="en_US.UTF-8"
        export LANG
    fi


Voila je peux pas faire plus. Je m'y connais pas assez en variables d'environnement.


Mon profil Steam

Hors ligne

#8 Le 12/06/2013, à 12:36

Nathaly01

Re : Que fait exactement ce script ?

Je te remercie vraiment pour ces explications.
Je vais continuer à chercher, tenter de modifier directement le fichier.
A pire, si sa plante tout le système, je réinstallerais !!!!

Hors ligne

Haut de page ↑