Not logged in. · Lost password · Register
Forum: Community Feature Requests RSS
Control PSI via commandline

Announcement

11-16-2005, 12:33 by halr9000
Subject: Psi Groupchat (new address)
Join us at the Psi Groupchat (MUC)! Room name: psi@conference.psi-im.org
Page:  1  2  next 
mgaugusch #1
Member since 01/2006 · 2 posts
Group memberships: Members
Show profile · Link to this post
Subject: Control PSI via commandline
Hi,

I'm using Linux on my Desktop, with Software Suspend (http://suspend2.net). When I suspend my machine I need to go offline in PSI manually, which I sometimes forget (and people see me online although I'm not there anymore).
Therefore I'd like to have some possibility to tell PSI to go offline and online (before/after suspend, respectively) via some kind of signal or commandline switch.

I have also noticed, that psi will lose messages that are sent if the PC is turned off and the user did not go offline. This is rather bad, but I'll file a separate bug report for that. (Tested with 0.9)
Avatar
michalj (Moderator) #2
Member since 04/2004 · 2260 posts · Location: Legionowo, Poland
Group memberships: Global Moderators, Members
Show profile · Link to this post
Try new Psi-0.10 - it supports suspend on Linux.
Michał Jazłowiecki (michalj)
Psi Forum & Wiki Moderator :: Psi-Daisy Author
mgaugusch #3
Member since 01/2006 · 2 posts
Group memberships: Members
Show profile · Link to this post
I can't see how. At the moment where I tell the OS to suspend, the network is already shut down by the suspend script and the application has no possibility to tell the server that it has gone offlline. I also tried the "lost messages" issue with 0.10 on two linux machines. It is still there :(
[EDIT]: I suspended for a few minutes, and the contact did not even go offline. The messages got delivered a while after resuming (but not in correct order). I'll try suspending until the contact really goes offline and see if the messages arrive in that case.
This post was edited on 01-21-2006, 05:22 by mgaugusch.
IceRAM (Moderator) #4
Member since 05/2003 · 1286 posts · Location: Bucharest, Romania
Group memberships: Global Moderators, Members
Show profile · Link to this post
Psi does not support suspend on Linux, since there is no standard for this on Linux. Psi 0.10 release announcement mentions suspend support only for Windows and Mac OS (AFAIR).

Also, Psi does not have a way of detecting that the network is down and relies on the OS to notify the application that the connection is down. This may take up to 180+ secs (I've tested this some time ago), depending on the OS configuration (there are some configs for the network layer, regarding number of retries etc.). Psi does not detect internally that a connection has timed out.

Edit:
Related forum topic: http://forum.psi-im.org/thread/2994
Created new design document: http://psi-im.org/wiki/Inter-Process_Communication
::/ my .net presence / weblog | psi
This post was edited on 01-21-2006, 06:26 by IceRAM.
Avatar
red_alert #5
Member since 08/2005 · 124 posts · Location: Switzerland
Group memberships: Members
Show profile · Link to this post
I think michalj was refering to software suspend (part of the kernel), not software suspend 2 (not part of the kernel and a hell of development).
I guess you better ask the swsusp2 people. They were very helpfully when I last used their software.
If you find any (coarse) mistakes in my English (e.g. grammar, sentence structure, wrong words used, misspellings that are not just typos, ...), please tell me. I appreciate any help in these matters.

[Image: http://hidentity.org/hid/CH565592.gif]
Avatar
spike (Administrator) #6
Member since 02/2003 · 1896 posts · Location: Leuven (Belgium)
Group memberships: Administrators, Developers, Members
Show profile · Link to this post
And for the losing of messages: yes, that is the problem that comes with the fact that you don't log out properly. It's like pulling the network cable while connected: the server doesn't know you're offline, and keeps on sending you the messages. There's not much you can do about it, except log out properly whenever possible (such as with suspend). We do that on Windows and Mac OS X, but no code has been written for Linux yet.

Jabber still needs a formal protocol to do acknowledging of message receiving. This would help in the case where you are really shut down unexpectedly (like pulling the network cable).
- Remko
Avatar
spike (Administrator) #7
Member since 02/2003 · 1896 posts · Location: Leuven (Belgium)
Group memberships: Administrators, Developers, Members
Show profile · Link to this post
Quote by red_alert:
I think michalj was refering to software suspend (part of the kernel), not software suspend 2 (not part of the kernel and a hell of development).
I don't understand what you are referring to. Anyway, IceRAM is right, we don't listen to 'suspend' messages on Linux yet. If someone can provide a piece of code for Linux, we would be glad to include it.
- Remko
Avatar
michalj (Moderator) #8
Member since 04/2004 · 2260 posts · Location: Legionowo, Poland
Group memberships: Global Moderators, Members
Show profile · Link to this post
I've written about supporting suspend on Linux in Psi before I took a look at Psi sources.

Yes, I was thinking about kernel supported suspend. On the other hand: doesn't Linux send SIGPWR (or how is it called) signal to all processes running in system?
Michał Jazłowiecki (michalj)
Psi Forum & Wiki Moderator :: Psi-Daisy Author
Avatar
spike (Administrator) #9
Member since 02/2003 · 1896 posts · Location: Leuven (Belgium)
Group memberships: Administrators, Developers, Members
Show profile · Link to this post
Quote by mgaugusch:
Therefore I'd like to have some possibility to tell PSI to go offline and online (before/after suspend, respectively) via some kind of signal or commandline switch.
'killall psi' when suspending, and 'psi' when starting ?
- Remko
Avatar
michalj (Moderator) #10
Member since 04/2004 · 2260 posts · Location: Legionowo, Poland
Group memberships: Global Moderators, Members
Show profile · Link to this post
'killall psi' would send SIGTERM to all Psi instances and will cause all of them to die prematurely (just like crashing Psi) - all settings will be lost, etc.
Michał Jazłowiecki (michalj)
Psi Forum & Wiki Moderator :: Psi-Daisy Author
Avatar
red_alert #11
Member since 08/2005 · 124 posts · Location: Switzerland
Group memberships: Members
Show profile · Link to this post
Quote by michalj:
'killall psi' would send SIGTERM to all Psi instances and will cause all of them to die prematurely (just like crashing Psi) - all settings will be lost, etc.

AFAIK does killall send SIGKILL and not SIGTERM unless specified. But you can also specify another signal, HUP (hangup), INT (terminal interrupt), QUIT (terminal quit),  ABRT (process abort) which are less abrupt than KILL (ALRM and TERM would be more abrupt). I don't know, which of them does cause Psi to quit normally though.
The exact command, e.g. for HUP: `killall -s SIGHUP psi`
If you find any (coarse) mistakes in my English (e.g. grammar, sentence structure, wrong words used, misspellings that are not just typos, ...), please tell me. I appreciate any help in these matters.

[Image: http://hidentity.org/hid/CH565592.gif]
Avatar
cliff_dugal #12
User title: Mandriva Packager
Member since 01/2004 · 220 posts · Location: Ottawa, Ontario, Canada
Group memberships: Members
Show profile · Link to this post
There's a script that works with Kopete here. It's not so great of a method for suspending IMO, but it is a method.
emdej #13
Member since 11/2006 · 5 posts
Group memberships: Members
Show profile · Link to this post
Has anything changed? I saw sollution for pidgin - they send dbus messages during suspend/resume.
Avatar
spike (Administrator) #14
Member since 02/2003 · 1896 posts · Location: Leuven (Belgium)
Group memberships: Administrators, Developers, Members
Show profile · Link to this post
Quote by emdej:
Has anything changed? I saw sollution for pidgin - they send dbus messages during suspend/resume.
Nothing has changed on the subject of controlling Psi from command line.

However, 0.11 goes offline correctly under Windows and Mac OS X when going into suspend/sleep. For Linux, this functionality still needs to be implemented. Using dbus for this sounds like a hack requiring extra work from the user. We would like to have this functionality built-in (if this is at all possible on Linux).
- Remko
This post was edited on 06-30-2007, 09:10 by spike.
emdej #15
Member since 11/2006 · 5 posts
Group memberships: Members
Show profile · Link to this post
Extra work, in this case, means a bit of code in hibernate script - no problem in my opinion. Another possible method to do that with signal, for example SIGPWR.
Hack? maybe, but many people just need it. I think, implementation of "disconnect on SIGPWR" is not so hard..
Close Smaller – Larger + Reply to this post:
Smilies: :mellow: :huh: ^_^ :o ;) :P :D :lol: B) :rolleyes: -_- <_< :) :wub: :angry: :( :unsure: :wacko: :blink: :ph34r:
Special characters:
Page:  1  2  next 
Go to forum
Unclassified NewsBoard devel of 20051113 © 2003-5 by Yves Goergen
Current time: 08-27-2008, 20:29:18 (UTC -04:00)