Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

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'm using a script based on the work posted here: Update pidgin status using cron

I'm trying to make a wicd script that automaticly disconnects before Wifi-disconnect and reconnects on Wifi-reconnect.

But somehow dbus/pidgin can't seem to find the dbus session, eventhough the environment variable is set.

My setup:

  • Arch linux
  • Pidgin 2.9.0
  • Libpurple 2.9.0-2

Autoload script (runs on Xfce start):

touch /tmp/dbus_session_data
env | grep DBUS_SESSION_BUS_ADDRESS > /tmp/dbus_session_data
echo 'export DBUS_SESSION_BUS_ADDRESS' >> /tmp/dbus_session_data

The tmp-file after runnign script:

[skaverat@eeepthought ~]$ cat /tmp/dbus_session_data 

Okay, let's get into another environment:

[root@eeepthought ~]# env | grep DBUSD
[root@eeepthought ~]# source /tmp/dbus_session_data 
[root@eeepthought ~]# env | grep DBUS
[root@eeepthought ~]# purple-remote getstatus
No existing libpurple instance detected.

purple-remote call in normal environment:

[skaverat@eeepthought ~]$ purple-remote getstatus

Any idea what could be wrong?

share|improve this question

DBus session can't be shared for different users, that's how it was designed.

I might not get your current solution, why're you trying to do it with root?

If so, use su - USERNAME -c /path/to/this/script.sh to launch a script like this,

. ~/.dbus/session-bus/*
purple-remote getstatus

This will work for the root user.

P.S: why wouldn't you set up the cron as the user who loggined through pidgin??

share|improve this answer

You can't, as far as I am aware connect to another users D-Bus session. So root@eeepthought, being a different user, was refused permission to connect to the D-Bus session of skaverat@eeepthought. That is all that is wrong with what you've done.

share|improve this answer

Your Answer


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

Not the answer you're looking for? Browse other questions tagged or ask your own question.