You are not logged in.
hi, i've just managed to get suspend-to-ram and suspend-to-disk working on my laptop and have been successful in linking them to different acpi events and laptop-mode-tool thresholds (eg. low battery)
i am big user of rdesktop on my laptop which i use to conect to my main pc in my bedroom.
rdesktop -f -u dan -p <password> 10.0.0.3
my question is how would i go about getting pm-hibernate/suspend to cleanly disconnect from any active rdesktop sessions (normally just the one) before taking down my network connection? (no need to reconnect upon resume)
Fujitsu Siemens Lifebook S7020 - 2.0ghz Centrino | 2gig RAM | 80gig SATA HDD
Offline
Seems a very basic script would do the trick. Simply create a new file in your home directory eg... pm_suspend, make it executable, and place the following in it. Then simply run the script. It's not fancy but will do the trick.
killall rdesktop
sleep 2
sudo pm-suspend
Offline
figured it would be something simple like that.
what does the second line do btw?
not too familar with all the essential commands yet having just made the jump from pre-school (ubuntu) straight to big school (arch with openbox). about time i started actually learning instead of just using
Fujitsu Siemens Lifebook S7020 - 2.0ghz Centrino | 2gig RAM | 80gig SATA HDD
Offline
"sleep 2" will simply pause execution for two seconds, allowing "rdesktop" to be fully killed before continuing.
I think the more "correct" way to go about this, by the way, is to create a hook in /etc/pm/sleep.d. See the pm-suspend manpage for details (under the "files" section). This would also allow you to have pm-suspend restart your connection on resume.
...of course, there are those that would argue that the "correct" way is simply any way that works. To each his/her own.
Last edited by pointone (2008-10-06 22:58:53)
M*cr*s*ft: Who needs quality when you have marketing?
Offline
cheers, thats something to try tomorrow, i'll get the quick and dirty script working and then see if i can do it with hooks
Fujitsu Siemens Lifebook S7020 - 2.0ghz Centrino | 2gig RAM | 80gig SATA HDD
Offline
Yes, I agree with @pointone suggestion as the more elegant way to do it. But the files in /etc/pm/sleep.d are simply scripts as well.
Offline
I think that the advtange of using hook scripts is that they are placed where they should be, if you were building each script wherever you want, you would have a lot of scripts everywhere in would be difficult to know what they do.
For me is like they are placed where they should be, and not in a messed way.
ISC - Ignacio Marmolejo
ArchLinux & GNOME User.
Offline
The other benefit is that pm-* calls scripts in /etc/pm/sleep.d with the arguement "sleep/hibernate" on sleep/hibernate and with "resume/thaw" on resume/thaw. This allows you to easily restart/undo whatever you needed to stop/change before suspending.
M*cr*s*ft: Who needs quality when you have marketing?
Offline
@pointone & @allienman I agree with the both of you about the placement of the file(s). I like good house keeping as well. But he did say he did not care about his rdesktop connection being resumed. Anywho, he has his solution. Arch ON!
Offline
@dan653
Wonderful that you found the answer. Please mark this thread as solved (edit your first post). That way, others with this question can find help easily. Thanks.
Offline