Forum général.général couldn't attach to dcop server

Posté par  .
Étiquettes : aucune
0
27
juil.
2005
Hi,

I am working under Linux and recently under KUbuntu 5.04.
I create two users : me and a guest user account.
When i log on the guest account using su command (in Konsole), I received the following message, repeated at each command line...

"couldn't attach to dcop server"

I haven't found any solution...

In fact, I made a third user : root. When I log using su, I got the same message BUT if i log using su - root, the message did not appear... magic ... but no solution for my guest account...
  • # humm

    Posté par  (site web personnel, Mastodon) . Évalué à 3.

    what's the shell for guest account ?

    i presume bash, can you post guest's ~/.bashrc and ~/.bash_profile and /etc/bash* ?

    M.
    • [^] # Re: humm

      Posté par  . Évalué à 1.

      Voici, merci.

      Oui, peut être faut-il ajouter une option après les commandes dcop... --user ou autre ?

      .bashrc
      ------------

      # ~/.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

      # 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

      # 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" -a -r /etc/debian_chroot ]; then
      debian_chroot=$(cat /etc/debian_chroot)
      fi

      export PATH="/sbin:/usr/sbin:/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin:/lib:/usr/X11R6/lib":$PATH

      case `whoami` in
      root)
      USER_AT_HOST="${USER}@${HOSTNAME%%.*}"
      ;;
      *)
      USER_AT_HOST="${USER}@${HOSTNAME%%.*}"
      ;;
      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|eterm)
      #PROMPT_COMMAND='echo -ne "\033]0;${USER}: ${PWD/$HOME/~}\007";dcop $KONSOLE_DCOP_SESSION renameSession ${PWD/$HOME/~}'
      #;;
      PROMPT_COMMAND='echo -ne "\033]0;\007";dcop $KONSOLE_DCOP_SESSION renameSession $USER_AT_HOST" ":" "${PWD/$HOME/~}'
      ;;
      screen)
      PROMPT_COMMAND='echo -ne "\033_${USER}: ${PWD/$HOME/~}\033\\";dcop $KONSOLE_DCOP_SESSION renameSession ${PWD/$HOME/~}'
      ;;
      *)
      ;;
      esac

      # Define your own aliases here ...
      if [ -f ~/.bash_aliases ]; then
      . ~/.bash_aliases
      fi

      # 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


      # This line was appended by KDE
      # Make sure our customised gtkrc file is loaded.
      export GTK2_RC_FILES=$HOME/.gtkrc-2.0

      .bash_profile
      --------------------
      # ~/.bash_profile: executed by bash(1) for login shells.
      # see /usr/share/doc/bash/examples/startup-files for examples.
      # the files are located in the bash-doc package.

      # the default umask is set in /etc/login.defs
      #umask 022

      xhost + local:

      # include .bashrc if it exists
      if [ -f ~/.bashrc ]; then
      . ~/.bashrc
      fi

      # set PATH so it includes user's private bin if it exists
      if [ -d ~/bin ] ; then
      PATH=~/bin:"${PATH}"
      fi

      export DISPLAY=:0.0
      • [^] # Re: humm

        Posté par  . Évalué à 1.

        Apparemment, c'est parce qu'il n'arrive pas à trouver la session KDE.

        Comment affecte t-on la variable $DCOPSERVER ?...

        ERROR: No active KDE sessions!
        If you are sure there is one, please set the $DCOPSERVER variable manually
        • [^] # Re: humm

          Posté par  (site web personnel, Mastodon) . Évalué à 3.

          comme tous les comptes partage le meme .bashrc, c'est dans cette ligne que tout foire :

          PROMPT_COMMAND='echo -ne "\033]0;\007";dcop $KONSOLE_DCOP_SESSION renameSession $USER_AT_HOST" ":" "${PWD/$HOME/~}'

          et surtout ça :

          dcop $KONSOLE_DCOP_SESSION renameSession ${PWD/$HOME/~}, cette ligne permet de renommer l'onglet courant de konsole avec le répertoire de travail !

          dcop ne peut pas se "connecter" à ta session kde lancer en tant que toi même : pas les droits !

          Solution rapide : commenter tous les PROMPT_COMMAND dans les .bashrc des comptes avec lequels tu te connecte avec su dans ta session !

          M.
  • # difference between su user and su - user

    Posté par  . Évalué à 3.

    from AIX manpage:


    - Specifies that the process environment is to be set as if the user had logged in to the system using the login command. Nothing in the current environment is propagated to the new shell.


    Without -, the current environment is propagated to the new shell.
  • # solution

    Posté par  (site web personnel) . Évalué à 3.

    you should try, in a terminal :

    xhost +

    and then retry

    dcopserver_shutdown && kdeinit_shutdown

    can help too
  • # SOLUTION

    Posté par  . Évalué à 1.

    Tout d'abord, merci à tous pour votre aide et l'inspiration que permet ce type de discussion.

    Pour la soluce, voici ce que j'ai du faire pour éviter ces messages de dcop ...

    Dans le .bashrc de tous les users, mettre :

    DCOPSERVER=`cat /home/LeUserLogin/.DCOPserver_sec-4_:0 | grep local`
    export DCOPSERVER

    et appelez la commande dcop, exemple :


    PROMPT_COMMAND='echo -ne "\033]0;\007";dcop $KONSOLE_DCOP_SESSION renameSession $USER_AT_HOST" ":" "${PWD/$HOME/~}'


    Voilà,
    merci à tous !

Suivre le flux des commentaires

Note : les commentaires appartiennent à celles et ceux qui les ont postés. Nous n’en sommes pas responsables.