Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I've already set up wake on LAN (via WIFI local network) and I am able to wake my Ubuntu machine via local network (from Windows 7 laptop using WakeOnLan from Magick Packet).

Is there a way to suspend on LAN the same machine?

I hate going downstairs each time I finish remote LAN work.

share|improve this question

1 Answer 1

up vote 3 down vote accepted

Yes, via SSH. Set up openssh-server on your computer to proceed. Next, have a look at this page to find the appropriate command to invoke the suspend. You could simply use sudo pm-suspend, however, this requires root priviliges.

Now, turn the suspend command into a Bash alias by adding the following to your .bashrc:

alias suspendnow='dbus-send --print-reply --system --dest=org.freedesktop.UPower /org/freedesktop/UPower org.freedesktop.UPower.Suspend'

Save, log out and back in again.

Now, if everything is set up correctly, you could run:

ssh user@computer -f 'suspendnow'

to initiate the suspend of your computer. Note, this might not work on a server, you'll have to use sudo pm-suspend instead of the fancy dbus method.

share|improve this answer
    
it's a local machine so I managed this via putty + sudo pm-suspend. thanks! –  ubuntico Jul 17 '12 at 7:04

Your Answer

 
discard

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.