Opensuse 11.3 Hibernation on disk

Hi, I have a problem with Suse and I wonder if anyone can help me:
I’m running a SUSE 11.3 64 bit with the kernel installed friom repo
when I send the hard disk suspension the screen goes black, the SUSE chameleon image appear on the screen for about a second with a progress bar ,then the monitor goes into standby ,the system still running and I have to manually restart.
I also tried to run s2disk-r / dev/sdb6 console or via pm-hibernate with similar results.
I have ever had similar problems with previous openSUSE (swap partition is not defined, problems of user privileges to be assigned for the suspension) but I was always able to solve them, this time I have no idea what it might be.
One thing I noticed is that the swap is not used, even if enabled, but basically I do not even the heavily occupied RAM.
Thanks in advance for any help

I am attaching my configuration files:

more /boot/grub/menu.lst

Modified by YaST2. Last modification on Sun Oct 10 03:33:23 CEST 2010

THIS FILE WILL BE PARTIALLY OVERWRITTEN by perl-Bootloader

Configure custom boot parameters for updated kernels in /etc/sysconfig/bootloader

default 2
timeout 8
##YaST - activate

###Don’t change this comment - YaST2 identifier: Original name: linux###
title Desktop – openSUSE 11.3 - 2.6.34-12
root (hd0,4)
kernel /vmlinuz-2.6.34-12-desktop root=/dev/disk/by-id/ata-Maxtor_6Y160M0_Y44LB5PE-part7 resume=/dev/disk/by-id/ata-Maxtor_6Y160M0_Y44LB5
PE-part6 splash=silent quiet showopts vga=0x31a
initrd /initrd-2.6.34-12-desktop

###Don’t change this comment - YaST2 identifier: Original name: failsafe###
title Failsafe – openSUSE 11.3 - 2.6.34-12
root (hd0,4)
kernel /vmlinuz-2.6.34-12-desktop root=/dev/disk/by-id/ata-Maxtor_6Y160M0_Y44LB5PE-part7 showopts apm=off noresume edd=off powersaved=off
nohz=off highres=off processor.max_cstate=1 nomodeset x11failsafe vga=0x31a
initrd /initrd-2.6.34-12-desktop

###Don’t change this comment - YaST2 identifier: Original name: windows 1###
title Windows
map (hd0) (hd0)
map (hd0) (hd0)
rootnoverify (hd0,0)
makeactive
chainloader +1

###Don’t change this comment - YaST2 identifier: Original name: floppy###
title Dischetto
rootnoverify (hd0,0)
chainloader +1
**
dmesg | grep PM**
0.000000] [ffffea0000000000-ffffea0000dfffff] PMD -> [ffff880002600000-ffff8800033fffff] on node 0
0.000000] ACPI: PM-Timer IO Port: 0x808
0.000000] PM: Registered nosave memory: 000000000009f000 - 00000000000a0000
0.000000] PM: Registered nosave memory: 00000000000a0000 - 00000000000e4000
0.000000] PM: Registered nosave memory: 00000000000e4000 - 0000000000100000
0.004071] Performance Events: AMD PMU driver.
0.220507] pci 0000:00:09.0: PME# supported from D0 D1 D2 D3hot D3cold
0.220512] pci 0000:00:09.0: PME# disabled
0.220589] pci 0000:00:0a.0: PME# supported from D0 D1 D2 D3hot D3cold
0.220593] pci 0000:00:0a.0: PME# disabled
0.220663] pci 0000:00:0d.0: PME# supported from D1 D2 D3hot D3cold
0.220667] pci 0000:00:0d.0: PME# disabled
0.220873] pci 0000:00:10.0: PME# supported from D0 D1 D2 D3hot D3cold
0.220877] pci 0000:00:10.0: PME# disabled
0.220939] pci 0000:00:10.1: PME# supported from D0 D1 D2 D3hot D3cold
0.220943] pci 0000:00:10.1: PME# disabled
0.221008] pci 0000:00:10.2: PME# supported from D0 D1 D2 D3hot D3cold
0.221013] pci 0000:00:10.2: PME# disabled
0.221075] pci 0000:00:10.3: PME# supported from D0 D1 D2 D3hot D3cold
0.221079] pci 0000:00:10.3: PME# disabled
0.221141] pci 0000:00:10.4: PME# supported from D0 D1 D2 D3hot D3cold
0.221146] pci 0000:00:10.4: PME# disabled
0.527162] PM: Checking image partition /dev/disk/by-id/ata-Maxtor_6Y160M0_Y44LB5PE-part6
1.427052] PM: Resume from disk failed.
3.398382] PM: Marking nosave pages: 000000000009f000 - 0000000000100000
3.398388] PM: Basic memory bitmaps created
3.408394] PM: Basic memory bitmaps freed
3.421439] PM: Starting manual resume from disk
3.421443] PM: Resume from partition 8:22
3.421445] PM: Checking hibernation image.
3.421685] PM: Error -22 checking image file
3.421687] PM: Resume from disk failed.

more /var/log/pm-suspend.log
Initial commandline parameters:
gio 2 dic 2010, 01.03.01, CET: Running hooks for hibernate.
/usr/lib/pm-utils/sleep.d/00logging hibernate hibernate:hibernate initiated: gio 2 dic 2010, 01.03.01, CET

Linux workstation 2.6.34-12-desktop #1 SMP PREEMPT 2010-06-29 02:39:08 +0200 x86_64 x86_64 x86_64 GNU/Linux
kernel command line: ‘root=/dev/disk/by-id/ata-Maxtor_6Y160M0_Y44LB5PE-part7 resume=/dev/disk/by-id/ata-Maxtor_6Y160M0_Y44LB5PE-part6 splash=
silent quiet showopts vga=0x31a’
Module Size Used by
vmnet 53366 13
vmblock 14435 1
vsock 47725 0
vmci 66790 1 vsock
vmmon 88159 0
w83627hf 32833 0
hwmon_vid 3226 1 w83627hf
tmdc 6461 0
snd_pcm_oss 53669 0
snd_mixer_oss 19415 1 snd_pcm_oss
snd_seq_midi 7020 0
snd_seq_midi_event 7907 1 snd_seq_midi
snd_seq 68137 2 snd_seq_midi,snd_seq_midi_event
edd 10208 0
cpufreq_conservative 12628 0
cpufreq_userspace 3264 0
cpufreq_powersave 1258 0
powernow_k8 20075 0
mperf 1523 1 powernow_k8
fuse 75897 7
loop 18524 0
dm_mod 86809 0
snd_via82xx 26567 2
snd_via82xx_modem 12236 0
snd_ac97_codec 133508 2 snd_via82xx,snd_via82xx_modem
snd_mpu401 7528 0
ac97_bus 1578 1 snd_ac97_codec
snd_mpu401_uart 8169 2 snd_via82xx,snd_mpu401
snd_pcm 105589 4 snd_pcm_oss,snd_via82xx,snd_via82xx_modem,snd_ac97_codec
amd64_edac_mod 29009 0
ppdev 10072 0
snd_rawmidi 26945 2 snd_seq_midi,snd_mpu401_uart
ark3116 10466 0
edac_core 50480 3 amd64_edac_mod
snd_timer 26828 2 snd_seq,snd_pcm
sr_mod 16684 0
parport_pc 37547 0
snd_seq_device 7834 3 snd_seq_midi,snd_seq,snd_rawmidi
ns558 4210 0
8139too 35056 0
floppy 68349 0
button 6989 0
shpchp 35076 0
usbserial 41885 1 ark3116
edac_mce_amd 9619 1 amd64_edac_mod
k8temp 4264 0
sg 33348 0
snd 84348 17 snd_pcm_oss,snd_mixer_oss,snd_seq_midi,snd_seq,snd_via82xx,snd_via82xx_modem,snd_ac97_codec,snd_mpu401,snd_m
pu401_uart,snd_pcm,snd_rawmidi,snd_timer,snd_seq_device
cdrom 43440 1 sr_mod
usb_storage 52819 0
parport 40384 2 ppdev,parport_pc
soundcore 9003 1 snd
joydev 11942 0
i2c_viapro 7497 0
gameport 12438 4 tmdc,snd_via82xx,ns558
pcspkr 2222 0
8139cp 25315 0
snd_page_alloc 9569 3 snd_via82xx,snd_via82xx_modem,snd_pcm
tulip 55564 0
pci_hotplug 33005 1 shpchp
skge 46690 0
ext4 401724 1
jbd2 100410 1 ext4
crc16 1715 1 ext4
radeon 868464 3
ttm 65906 1 radeon
drm_kms_helper 33008 1 radeon
drm 221762 5 radeon,ttm,drm_kms_helper
i2c_algo_bit 6728 1 radeon
sd_mod 41436 6
fan 4527 0
thermal 20625 0
processor 45715 1 powernow_k8
thermal_sys 18230 3 fan,thermal,processor
ata_generic 3707 0
sata_via 10264 5
pata_via 9800 0
libata 211330 3 ata_generic,sata_via,pata_via
scsi_mod 191748 5 sr_mod,sg,usb_storage,sd_mod,libata

total used free shared buffers cached
Mem: 1021492 673872 347620 0 24436 336916
-/+ buffers/cache: 312520 708972
Swap: 1991992 0 1991992

success.
/usr/lib/pm-utils/sleep.d/00powersave hibernate hibernate:success.
/usr/lib/pm-utils/sleep.d/02rtcwake hibernate hibernate:rtcwake alarm not enabled in /etc/pm/config.d/rtcwake.config, doing nothing…
not applicable.
/usr/lib/pm-utils/sleep.d/06autofs hibernate hibernate:not applicable.
/usr/lib/pm-utils/sleep.d/30s2disk-check hibernate hibernate:INFO: checking for suspend-to-disk prerequisites…
using userspace suspend method
setting resume device to /dev/sdb6
setting image size to 470703513
adding these parameters from /etc/suspend.conf:
success.
/usr/lib/pm-utils/sleep.d/45pcmcia hibernate hibernate:not applicable.
/usr/lib/pm-utils/sleep.d/49bluetooth hibernate hibernate:not applicable.
/usr/lib/pm-utils/sleep.d/50rcnetwork hibernate hibernate:not applicable.
/usr/lib/pm-utils/sleep.d/55NetworkManager hibernate hibernate:not applicable.
/usr/lib/pm-utils/sleep.d/75modules hibernate hibernate:success.
/usr/lib/pm-utils/sleep.d/80acpi-fan hibernate hibernate:not applicable.
/usr/lib/pm-utils/sleep.d/80videobios hibernate hibernate:not applicable.
/usr/lib/pm-utils/sleep.d/90clock hibernate hibernate:not applicable.
/usr/lib/pm-utils/sleep.d/94cpufreq hibernate hibernate:success.
/usr/lib/pm-utils/sleep.d/95led hibernate hibernate:not applicable.
/usr/lib/pm-utils/sleep.d/98video-quirk-db-handler hibernate hibernate:success.
/usr/lib/pm-utils/sleep.d/99Zgrub hibernate hibernate:INFO: running prepare-grub
Skipping grub entry #1, because it has the noresume option
running kernel is grub menu entry 0 (vmlinuz-2.6.34-12-desktop)
preparing boot-loader: selecting entry 0, kernel /boot/2.6.34-12-desktop
grub-once: saving original /boot/grub/default
running ‘/usr/sbin/grubonce 0’
Using entry #0: Desktop – openSUSE 11.3 - 2.6.34-12
time needed for sync: 0.6 seconds, time needed for grub: 0.2 seconds.
success.
/usr/lib/pm-utils/sleep.d/99info hibernate hibernate:not applicable.
/usr/lib/pm-utils/sleep.d/99video hibernate hibernate:success.
gio 2 dic 2010, 01.03.03, CET: performing hibernate
INFO: using built-in quirks database from HAL.
INFO: S2RAM_OPTS from HAL quirks: ’ '.

On 2010-12-02 16:06, andreaflo wrote:
>
> Hi, I have a problem with Suse and I wonder if anyone can help me:
> I’m running a SUSE 11.3 64 bit with the kernel installed friom repo
> when I send the hard disk suspension the screen goes black, the SUSE
> chameleon image appear on the screen for about a second with a progress
> bar ,then the monitor goes into standby ,the system still running and I
> have to manually restart.

Disable the progress bar, get the textual info.
/etc/suspend.conf:

splash = n

> I also tried to run s2disk-r / dev/sdb6 console

Hum!

> or via pm-hibernate

Better.

> with similar results.

Disable the splash and retry. Better if you are in text mode already
(ctrl-alt-f1). If that fails, try in runlevel 3. If that succeeds, video is
a problem: change driver (propietary/open).

> I am attaching my configuration files:

Next time do so as code:

Code:



Cheers / Saludos,

Carlos E. R.
(from 11.2 x86_64 “Emerald” at Telcontar)

Or use SUSE Paste

Should I have to reinstall again?
Maybe a package check on repair system would get the system to work…
Now i remember that when I performed the installation I deselect all default package selection and I installed only a very minimal system; after I put Xorg and finally KDE4.
I have doubts about some essential package is missing … Grub also has a text menu not the standard graphical menu.

On 2010-12-02 18:06, andreaflo wrote:

> I have doubts about some essential package is missing … Grub also has
> a text menu not the standard graphical menu.

If you selected the minimal or text pattern, that would be expected.

You can check if there is something missing:

zypper verify

should report if something is missing (except if it doesn’t depend on
anything).


Cheers / Saludos,

Carlos E. R.
(from 11.2 x86_64 “Emerald” at Telcontar)

Suspension on RAM works flawlessy; Hibernation on disk succeed if i launch pm-hibernate with the option --quirk-radeon-off ( I have a Sapphire Radeon 9600 XT)

Maybe this helps you, the first time I installe opensuse on my 6gb ram laptop I create a 2.5gb swap partition… and I have the same or similar problem you have. Then I read somewhere (I think in the installation readme) that you need the same amount of swap partition as the ram you have. So, I just resized my swap partition and enable it and now hibernation works fine!

Thanks for the reply; well i don’t think this can be a problem because i’m reusing the same swap partition ( i perform a new installation whenever a new version opensuse come out but the partitions are the same reformatted) and in the previous installations even with problems involving hibernation i always succeed to make hibernation work at last.
Anyway i have 1 GB RAM and about 1 GB swap.

I know that the swap in linux is not used too much like in windows (you told that you noticed its not used, so that is normal) so… the only thing I think is that you have not enable the swap (you may have it created but the system is not using it)

If you su to root, you have some commands like swapon, swapoff… you can enable it if it is in your fstab, hope it helps you :frowning:

On 2010-12-09 15:36, andreaflo wrote:

> Anyway i have 1 GB RAM and about 1 GB swap.

That’s too little of both. It is enough on normal use, but the moment you
hibernate, you need more: there must be as much free swap as memory is in
use at that moment. However, the system should abort the hibernation and
tell you why.

Which is why I told you days ago to disable the splash display.


Cheers / Saludos,

Carlos E. R.
(from 11.2 x86_64 “Emerald” at Telcontar)

[QUOTE=robin_listas;2264592]On 2010-12-09 15:36, andreaflo wrote:

> Disable the splash and retry. Better if you are in text mode already
(ctrl-alt-f1). If that fails, try in runlevel 3. If that succeeds, video is
a problem: change driver (propietary/open).

I verify at home: 1 GB RAM and near 2 GB of swap; Anyway , I always perform successfully the hibernation after returning to runlevel 3 ( text mode) and launching pm-hibernate with the option --quirk-radeon-off
PS : I have a Sapphire Radeon 9600 XT and the video driver included in the distribution or in the community repos (not the ati repo because my kernel version does not match drivers version) → open source driver radeon for old cards support I suppose.
Is there a fix for that or actually there is nothing to do ?

[QUOTE=robin_listas;2264592]On 2010-12-09 15:36, andreaflo wrote:

> Disable the splash and retry. Better if you are in text mode already
(ctrl-alt-f1). If that fails, try in runlevel 3. If that succeeds, video is
a problem: change driver (propietary/open).

I verify at home: 1 GB RAM and near 2 GB of swap; Anyway , I always perform successfully the hibernation after returning to runlevel 3 ( text mode) and launching pm-hibernate with the option --quirk-radeon-off
PS : I have a Sapphire Radeon 9600 XT and the video driver included in the distribution or in the community repos (not the ati repo because my kernel version does not match drivers version) → open source driver radeon for old cards support I suppose.
Is there a fix for that or actually there is nothing to do ?

I verify at home: 1 GB RAM and near 2 GB of swap; Anyway , I always perform successfully the hibernation after returning to runlevel 3 ( text mode) and launching pm-hibernate with the option --quirk-radeon-off
PS : I have a Sapphire Radeon 9600 XT and the video driver included in the distribution or in the community repos (not the ati repo because my kernel version does not match drivers version) → open source driver radeon for old cards support I suppose.
Is there a fix for that or actually there is nothing to do ?

On 2011-02-07 18:36, andreaflo wrote:

> I verify at home: 1 GB RAM and near 2 GB of swap; Anyway , I always
> perform successfully the hibernation after returning to runlevel 3 (
> text mode) and launching pm-hibernate with the option --quirk-radeon-off

So your problem is video.

> PS : I have a Sapphire Radeon 9600 XT and the video driver included in
> the distribution or in the community repos (not the ati repo because my
> kernel version does not match drivers version) -> open source driver
> radeon for old cards support I suppose.
> Is there a fix for that or actually there is nothing to do ?

Argh :frowning:


Cheers / Saludos,

Carlos E. R.
(from 11.2 x86_64 “Emerald” at Telcontar)

After finding this thread I managed to get more robust hibernate and suspend working. To preserve the X Session I use Ctrl-Alt-F1 and login text console. From there I simply call up a very simple bash script which remakes my swap partition (before this thread I had been thinking that virtual paging was corrupting the space but maybe that was a red-herring and I can take those lines out) and then call pm-hibernate with --quirk-radeon-off. I am not 100% convinced the quirk is necessary but I’ve not had any failures yet with it in so it may as well stay.

With the script and a symlink to it moved to my home/bin folder and also a Sudo nopasswd exception created in Yast for pm-hibernate and suspend its very quick and painless. On resume ctrl-altF7 takes me back to my X Session and I have 1-click script top restore internet via ifdown/ifup.

One thing I am am clueless about how to achieve though is the security login prompt that I would get is I successfully hibernated or suspended via the normal UI route e.g. via ctrl-alt-del

pm-hibernate is supposed to be used for debugging only they say although the absence of a login prompt on resume is the only thing that I can tell is missing.

If I could add that then I would feel happier and more secure.

Ideally it would be great to be able to call the same ctrl-alt-del Hibernate or Suspend from the text console. The items are in the Slab Menu so I guess there must be some way of finding out what they call?

Any ideas welcome ;>}

On 2011-02-26 00:06, smudgy wrote:
>
> robin_listas;2287556 Wrote:
>> On 2011-02-07 18:36, andreaflo wrote:

>> So your problem is video.
>>
>
> After finding this thread I managed to get more robust hibernate and
> suspend working. To preserve the X Session I use Ctrl-Alt-F1 and login
> text console. From there I simply call up a very simple bash script
> which remakes my swap partition (before this thread I had been thinking
> that virtual paging was corrupting the space but maybe that was a
> red-herring and I can take those lines out) and then call pm-hibernate
> with --quirk-radeon-off. I am not 100% convinced the quirk is necessary
> but I’ve not had any failures yet with it in so it may as well stay.

Well, that’s about what I do, except that I call pm-hibernate as root.
There is another command that can be called from the CLI as plain user, but
I don’t remember which one it is… ah, yes, “powersave -U”. It depends on
policy kit.

> and I have 1-click script top restore internet via
> ifdown/ifup.

This one you could automate it, with a script in /etc/pm/sleep.d/

> One thing I am am clueless about how to achieve though is the security
> login prompt that I would get is I successfully hibernated or suspended
> via the normal UI route e.g. via ctrl-alt-del

Ah, yes. You have to activate the screensaver. Perhaps calling it manually.

> Ideally it would be great to be able to call the same ctrl-alt-del
> Hibernate or Suspend from the text console. The items are in the Slab
> Menu so I guess there must be some way of finding out what they call?

ctrl-alt-supr? Inittab.

On occasion I got the power button to trigger hibernation. Some versions it
worked, some did not.


Cheers / Saludos,

Carlos E. R.
(from 11.2 x86_64 “Emerald” at Telcontar)

Well, that’s about what I do, except that I call pm-hibernate as root.
There is another command that can be called from the CLI as plain user, but
I don’t remember which one it is… ah, yes, “powersave -U”. It depends on
policy kit.

> and I have 1-click script top restore internet via
> ifdown/ifup.

This one you could automate it, with a script in /etc/pm/sleep.d/

> One thing I am am clueless about how to achieve though is the security
> login prompt that I would get is I successfully hibernated or suspended
> via the normal UI route e.g. via ctrl-alt-del

Ah, yes. You have to activate the screensaver. Perhaps calling it manually.

> Ideally it would be great to be able to call the same ctrl-alt-del
> Hibernate or Suspend from the text console. The items are in the Slab
> Menu so I guess there must be some way of finding out what they call?

ctrl-alt-supr? Inittab.

On occasion I got the power button to trigger hibernation. Some versions it
worked, some did not.
Carlos E. R.

Thanks Carlos

Using powersave seems to throw in some additional stuff and the console output shows the internet problem. It slows the process down a bit but not too much.

I found this link for anyone else coming to this thread in future Suspend Stress Testing - openSUSE

Using powersave rejects the --quirk-radeon-off parameter but so far there doesn;t seem to be a problem… maybe because I am calling from runlevel 3

On resume it hangs after process at “resuming…” but just hitting return key completes resume in a nanosecond and brings up shellprompt on next line.

I don’t know if the quirk thing will become relevant again but it would be useful to know how to add quirks. I am not totally sure there.

Adding the script for eth0 restarting internet in a user created file 99local which I put in sleep.d (with executable set via gnomesu chmod u+x 99local) did the trick as you suggested. Thanks for that.

In inittab it gives the cli for ctrl-alt-del for when the key combo is used in text mode runlevel 3.
However I am after what ctrl=-alt-del does in GUI mode. In GUI mode that key combo brings up a popup window with options for Suspend Hibernate Restart Shutdown and choosing Suspend or Hibernate from them includes the login prompt.

I don’t know how to activate the screensaver. Surely the login prompt must be a component item of the resume process? There must be a separate call for that?

gnome-session-save --shutdown-dialog

In X Window this opens a dialog which contains Suspend and Hibernate buttons

So what I want to find out are the calls these GUI buttons make so that I can duplicate the functionality in text mode

Another thing Carlos …Why do you use pm-hibernate instead of powersave -U ?

On 2011-02-26 13:06, smudgy wrote:

> On resume it hangs after process at “resuming…” but just hitting
> return key completes resume in a nanosecond and brings up shellprompt on
> next line.

It is not hanging at all, it is the normal behaviour of that program.

> I don’t know if the quirk thing will become relevant again but it would
> be useful to know how to add quirks. I am not totally sure there.
>
> Adding the script for eth0 restarting internet in a user created file
> 99local which I put in sleep.d (with executable set via gnomesu chmod
> u+x 99local) did the trick as you suggested. Thanks for that.

It is not a user script, it is a system, root, script. Do not use sudo
there. You have examples in
“/usr/share/doc/packages/pm-utils/examples/hooks/”. The system scripts are
in “/usr/lib/pm-utils/sleep.d”.

> In inittab it gives the cli for ctrl-alt-del for when the key combo is
> used in text mode runlevel 3.
> However I am after what ctrl=-alt-del does in GUI mode. In GUI mode
> that key combo brings up a popup window with options for Suspend
> Hibernate Restart Shutdown and choosing Suspend or Hibernate from them
> includes the login prompt.

Yes, but you can simply switch to text mode and there type ctrl-alt-supr there.

Notice that runlevel 3 is not when you type ctrl-alt-f1 to go to text mode,
the graphical session is still running in VT7. Runlevel 3 means typing
“init 3” as root, which kills the desktop.

> I don’t know how to activate the screensaver. Surely the login prompt
> must be a component item of the resume process? There must be a separate
> call for that?

No, when the desktop suspends it first calls the screensaver, which in turn
locks the display and asks for the password. This happens before
hibernating, but you see it later. It is a program. The problem is calling
it as the user running the desktop.

It is also possible to adapt the scripts so that when you call hibernation
it goes to text mode before hibernating: I got the trick in a bugzilla,
I’ll look it up later for you.

You could call the screensaver in background, then hibernate, in the same
command line, in the desktop.


Cheers / Saludos,

Carlos E. R.
(from 11.2 x86_64 “Emerald” at Telcontar)

On 2011-02-26 16:06, smudgy wrote:

> So what I want to find out are the calls these GUI buttons make so that
> I can duplicate the functionality in text mode

Could be. But you have to do the call inside gnome, or the script will not
know about the running desktop.

Try gnome-screensaver, gnome-screensaver-command…

The first one is not the one. AH, you need the second one, look:

cer@Telcontar:~> gnome-screensaver-command --help
Usage:
gnome-screensaver-command [OPTION…]

Help Options:
-h, --help Show help options

Application Options:
–exit Causes the screensaver to exit gracefully
-q, --query Query the state of the screensaver
-t, --time Query the length of time the screensaver has
been active
-l, --lock Tells the running screensaver process to lock
the screen immediately
-c, --cycle If the screensaver is active then switch to
another graphics demo
-a, --activate Turn the screensaver on (blank the screen)
-d, --deactivate If the screensaver is active then deactivate
it (un-blank the screen)
-p, --poke Poke the running screensaver to simulate user
activity
-i, --inhibit Inhibit the screensaver from activating.
Command blocks while inhibit is active.
-n, --application-name The calling application that is inhibiting the
screensaver
-r, --reason The reason for inhibiting the screensaver
-V, --version Version of this application

It gives commands to the running screensaver. You need "
gnome-screensaver-command --activate --lock"

> Another thing Carlos …Why do you use pm-hibernate instead of powersave
> -U ?

I don’t remember :slight_smile:

Possibly because powersave refused to run. It checks if you have
permissions, or if your machine is listed as being able to hibernate, or
listed as not being able to. Instead of fighting that battle, I simply call
pm-hibernate as root.

Why not as user using sudo? Good question. Supposing I didn’t try and it
failed (I don’t remember), sometimes I’m lazy and continue doing it as root
instead.

O:-)


Cheers / Saludos,

Carlos E. R.
(from 11.2 x86_64 “Emerald” at Telcontar)