Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
qdbus and ssh
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

 
Reply to topic    Gentoo Forums Forum Index Desktop Environments
View previous topic :: View next topic  
Author Message
Frautoincnam
Apprentice
Apprentice


Joined: 19 May 2017
Posts: 294

PostPosted: Wed Mar 28, 2018 8:54 pm    Post subject: qdbus and ssh Reply with quote

Hi,

For several years, I use my own script to Inhibit/UnInhibit power management by ssh, to disable automatic suspend during update process. All work fine (initiated here viewtopic.php?f=66&t=118646)
Now, I'm installing a new laptop, always with gentoo.
Locally, I can do :
Code:
inhibit_cookie=$(qdbus org.freedesktop.PowerManagement.Inhibit /org/freedesktop/PowerManagement/Inhibit Inhibit "suspend" "need")

to Inhibit.
Then
Code:
qdbus org.freedesktop.PowerManagement.Inhibit /org/freedesktop/PowerManagement/Inhibit UnInhibit $inhibit_cookie

to UnInhibit.
But, if I do it by ssh, I get
Code:
Cannot find '.Inhibit' in object /org/freedesktop/PowerManagement/Inhibit at org.freedesktop.PowerManagement.Inhibit

Service 'org.freedesktop.PowerManagement.Inhibit' does not exist.

My simple code to test is :
Code:
christophe@svs15 ~ $ cat /home/christophe/tmp/test.sh
#!/bin/bash
export DISPLAY=":0"
echo "$USER"
inhibit_cookie=$(qdbus org.freedesktop.PowerManagement.Inhibit /org/freedesktop/PowerManagement/Inhibit Inhibit "suspend" "need")
echo $inhibit_cookie
qdbus org.freedesktop.PowerManagement.Inhibit /org/freedesktop/PowerManagement/Inhibit UnInhibit $inhibit_cookie

And I call it from another PC with :
Code:
ssh -x christophe@svs15 /home/christophe/tmp/test.sh

That's not a problem with the USER, the command, or the script because all of this work on others PC, and /home is a nfs mount.
So that's a problem with my new install, and I can't find what I've forgot. Surely something very stupid.
consolekit and dbus services running (And inhibit *works* locally in my plasma session)

May be can you help me to find what is not normal with dbus.

Thanks for you help.

[EDIT] Another thing not working, surely about dbus too :
Code:
christophe@svs15 ~ $ notify-send "text"
christophe@svs15

works fine, immediately
Code:
root@svs15 ~ # su - christophe -c "notify-send text"
root@svs15 ~ #

waits 35 secondes and doesn't notify anything. With or without DISPLAY=:0.0
Back to top
View user's profile Send private message
Frautoincnam
Apprentice
Apprentice


Joined: 19 May 2017
Posts: 294

PostPosted: Wed Mar 28, 2018 9:28 pm    Post subject: Reply with quote

Another thing I can note, maybe not important, is that on each PC where all is fine, I have same print-pid and print-adress for each dbus-daemon process :
Code:
root@cored ~ # ps axfu | grep print-pid | grep -v grep
sddm      3026  0.0  0.0  35100  2372 ?        Ss   mars26   0:00 /usr/bin/dbus-daemon --fork --print-pid 5 --print-address 7 --session
chris     3190  0.0  0.1  36324  4092 ?        Ss   mars26   0:02 /usr/bin/dbus-daemon --fork --print-pid 5 --print-address 7 --session
root     18567  0.0  0.0  34960  2508 ?        Ss   14:43   0:00 /usr/bin/dbus-daemon --fork --print-pid 5 --print-address 7 --session

Code:
root@medion ~ # ps axfu | grep print-pid | grep -v grep                                   
sddm      1669  0.0  0.0  35100  2356 ?        Ss   mars22   0:00 /usr/bin/dbus-daemon --fork --print-pid 5 --print-address 7 --session
regine    1697  0.0  0.1  36364  4312 ?        Ss   mars22   0:01 /usr/bin/dbus-daemon --fork --print-pid 5 --print-address 7 --session


and on this one, they are different :
Code:
root@svs15 ~ # ps axfu | grep print-pid | grep -v grep
sddm      1731  0.0  0.0  35264  2676 ?        Ss   17:19   0:00 /usr/bin/dbus-daemon --fork --print-pid 5 --print-address 7 --session
christo+  1803  0.0  0.0  35232  2780 ?        Ss   17:20   0:00 /usr/bin/dbus-daemon --fork --print-pid 6 --print-address 8 --session
christo+  1827  0.0  0.0  35488  3076 ?        Ss   17:20   0:00 /usr/bin/dbus-daemon --fork --print-pid 6 --print-address 8 --session


Is it normal ?
Back to top
View user's profile Send private message
Frautoincnam
Apprentice
Apprentice


Joined: 19 May 2017
Posts: 294

PostPosted: Fri Mar 30, 2018 3:37 pm    Post subject: Re: qdbus and ssh Reply with quote

Frautoincnam wrote:
My simple code to test is :

More simple, X session opened each time, /home is a nfs mount, centralized authentication with ldap :
Code:
$ ssh regine@medion "qdbus org.freedesktop.PowerManagement"
/
/MainApplication
/local
/local/org_kde_powerdevil
/org
/org/freedesktop
/org/freedesktop/PowerManagement
/org/freedesktop/PowerManagement/Inhibit
/org/kde
/org/kde/Solid
/org/kde/Solid/PowerManagement
/org/kde/Solid/PowerManagement/Actions
/org/kde/Solid/PowerManagement/Actions/HandleButtonEvents
/org/kde/Solid/PowerManagement/Actions/SuspendSession
/org/kde/Solid/PowerManagement/PolicyAgent

Code:
$ ssh regine@svs15 "qdbus org.freedesktop.PowerManagement"
Service 'org.freedesktop.PowerManagement' does not exist.


diff medion://etc and svs15://etc doesn't show anything really different to explain that.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Desktop Environments All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum