Page 5 of 7 FirstFirst ... 34567 LastLast
Results 41 to 50 of 67

Thread: [SOLVED] HowTo sleep / standby / hibernate / suspend from command line

  1. #41
    Join Date
    Aug 2005
    Beans
    139

    Re: [SOLVED] HowTo sleep / standby / hibernate / suspend from command line

    In case someone else runs across this thread wondering how to use the command line to suspend (S3) in Lucid 10.04 without becoming root or using sudo, I found the answer here:

    https://wiki.ubuntu.com/DebuggingGNOMEPowerManager

    The short answer (for suspend) is this command (all one line):

    Code:
     dbus-send --print-reply --system --dest=org.freedesktop.UPower /org/freedesktop/UPower org.freedesktop.UPower.Suspend

  2. #42
    Join Date
    Jun 2008
    Beans
    51
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Re: [SOLVED] HowTo sleep / standby / hibernate / suspend from command line

    marcw, when i run that command, terminal says:
    Error org.freedesktop.DBus.Error.ServiceUnknown: The name org.freedesktop.UPower was not provided by any .service files
    any ideas? using 10.10

    nevermind, i got it to work using HAL with:
    dbus-send --system --print-reply --dest="org.freedesktop.Hal" /org/freedesktop/Hal/devices/computer org.freedesktop.Hal.Device.SystemPowerManagement.S uspend int32:0
    Last edited by dli8ilb; October 20th, 2010 at 05:34 AM.

  3. #43
    Join Date
    Dec 2010
    Beans
    1

    Re: [SOLVED] HowTo sleep / standby / hibernate / suspend from command line

    Using Ubuntu 10.10 or 10.04 with default packages you can issue the command:
    Code:
    sudo pm-suspend
    other options are:
    pm-hibernate
    pm-powersave
    pm-suspend-hybrid

    hope that helps.

  4. #44
    Join Date
    May 2010
    Location
    Lancaster, CA
    Beans
    23
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Re: [SOLVED] HowTo sleep / standby / hibernate / suspend from command line

    I am using pam-face-authentication to replace passwords for sudo and login. No matter what I do when I suspend it has to verify me 4 times while suspending and another 4 upon resume, I thought finding a way to suspend without needing root would alleviate the problem, but it is still present even though I have tried all the ways to do so in the forum.

    Any thoughts?

  5. #45
    Join Date
    Jun 2007
    Beans
    51

    Re: [SOLVED] HowTo sleep / standby / hibernate / suspend from command line

    I suspect during suspend the power manager will send messages to the screensaver, X desktop manager (for example gdm), etc. to lock the screen. Normally if you lock the screen 4 times in a row (using different methods) you will only need to unlock it once. But your face detection screen lock apparently figures it needs to buffer all those locks and have you unlock each of them.

    Try to figure out how you can get in such a situation outside of suspending. So, try to lock the screen by timeout, and then send a lock message from commandline over SSH (or by cron).

    Then you'll have a testcase for the people of pam-face-authentication.

  6. #46
    Join Date
    Jun 2007
    Beans
    11

    Re: [SOLVED] HowTo sleep / standby / hibernate / suspend from command line

    Quote Originally Posted by Yoshizmo View Post
    Using Ubuntu 10.10 or 10.04 with default packages you can issue the command:
    Code:
    sudo pm-suspend
    other options are:
    pm-hibernate
    pm-powersave
    pm-suspend-hybrid

    hope that helps.
    You also need to install pm-utils before using these commands. Otherwise works fine.

  7. #47
    Join Date
    Jul 2006
    Location
    Golden, CO, USA
    Beans
    95
    Distro
    Ubuntu Gnome 13.10 Saucy Salamander

    Re: [SOLVED] HowTo sleep / standby / hibernate / suspend from command line

    ...and if you want to run pm-suspend without entering any password (I use it for example with:

    Code:
     
    do-long-video-rendering.sh && sudo pm-suspend
    ...and go to sleep), you can add to the file /etc/sudoers (edit it using sudo visudo) the line:

    Code:
    your_user_name ALL=NOPASSWD: /usr/sbin/pm-suspend
    Have a nice day,
    Romano --- Linux user since 1989: first kernel 0.99pl8, Slackware distro (on 40 floppies! )

  8. #48
    Join Date
    May 2011
    Location
    Greece,Creta
    Beans
    4

    Re: [SOLVED] HowTo sleep / standby / hibernate / suspend from command line

    Quote Originally Posted by motin View Post
    Code:
    echo 'pmi action suspend' | at now + 40 minutes
    How can actually suspend or hibernate in 40 minutes?
    Not echo it.

  9. #49
    Join Date
    Aug 2008
    Beans
    Hidden!

    Re: [SOLVED] HowTo sleep / standby / hibernate / suspend from command line

    The command shown will actually suspend in 40 minutes. echo puts the quoted text into stdout, and at reads the text piped from it - not the whole echo command, just its output.

    Why not try it?

  10. #50
    Join Date
    May 2011
    Location
    Greece,Creta
    Beans
    4

    Re: [SOLVED] HowTo sleep / standby / hibernate / suspend from command line

    Thanks i feel very stupid,do you know how to cancel it after trigger?

Page 5 of 7 FirstFirst ... 34567 LastLast

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •