Skip to main content
Topic solved
This topic has been marked as solved and requires no further attention.
Topic: [SOLVED] suspend / resume with .xinitrc (Read 2384 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

[SOLVED] suspend / resume with .xinitrc

Hello,

I want to use suspend without a desktop- or login-manager  - just .xinitrc and startx (OpenRC). The command I tried is "loginctl suspend". The machine seems to suspend and reacts on a keystroke then (wakes up), but the screen stays black and I can do nothing.

When doing "loginctl suspend" from the commandline everything seems to work, but not from FVWM / XServer. 
Something must be missing or I am doing it wrong.. (?)

Re: suspend / resume with .xinitrc

Reply #1
I believe it still should be working just fine.

I also login in tty and than run startx (my alias to add some options to it) and suspend works fine.
I use the same command you mentioned
Code: [Select]
loginctl suspend

I have to start my WM with dbus-launch to make some things work.
I have in my ~/.xinitrc following line (apart from other settings)
Code: [Select]
exec dbus-launch --sh-syntax --exit-with-session $1
where $1 is in my case always "openbox-session"

Errors:
From time to time I experience that system just freezes after waking up from suspend and I have no will to investigate it.

Re: suspend / resume with .xinitrc

Reply #2
I have now added the two options "--sh-syntax" and  "--exit-with-x11" but still not working. I have looked for a hint in /var/log but did not yet find something.

my .xinitrc :
Code: [Select]
#!/bin/sh

#userresources=$HOME/.Xresources
#usermodmap=$HOME/.Xmodmap
#sysresources=/etc/X11/xinit/.Xresources
#sysmodmap=/etc/X11/xinit/.Xmodmap

# merge in defaults and keymaps

#if [ -f $sysresources ]; then
#    xrdb -merge $sysresources
#fi

#if [ -f $sysmodmap ]; then
#    xmodmap $sysmodmap
#fi

#if [ -f "$userresources" ]; then
#    xrdb -merge "$userresources"
#fi

#if [ -f "$usermodmap" ]; then
#    xmodmap "$usermodmap"
#fi

# start some nice programs

if [ -d /etc/X11/xinit/xinitrc.d ] ; then
 for f in /etc/X11/xinit/xinitrc.d/?*.sh ; do
  [ -x "$f" ] && . "$f"
 done
 unset f
fi

#eval $(/usr/bin/gnome-keyring-daemon --start --components=pkcs11,secrets,ssh)
#export SSH_AUTH_SOCK
exec dbus-launch --sh-syntax --exit-with-x11 fvwm

Re: suspend / resume with .xinitrc

Reply #3
without providing any logs we only could use a crystal ball to help you…

Code: [Select]
lspci 
Code: [Select]
dmesg
Code: [Select]
 cat /var/log/Xorg.n.log

if machine suspends, will problably not problem with .xinitrc

Re: suspend / resume with .xinitrc

Reply #4
ok, here are the files/logs :

edit: there was an unused graphics card still plugged into the mainboard. (Turks ) which is deactivated in the bios.
I have just removed it, to see if it changes something. but it does not seem to change something.

Re: suspend / resume with .xinitrc

Reply #5
ok, here are the files/logs :

edit: there was an unused graphics card still plugged into the mainboard. (Turks ) which is deactivated in the bios.
I have just removed it, to see if it changes something. but it does not seem to change something.


dmesg show some errors

Code: [Select]
 
[    6.740094] ACPI Error: Aborting method \_SB.PCI0.PB21.VGA.ATC0 due to previous error (AE_NOT_FOUND) (20200326/psparse-529)
[    6.740105] ACPI Error: Aborting method \_SB.PCI0.PB21.VGA.ATCS due to previous error (AE_NOT_FOUND) (20200326/psparse-529)
 7.799259] radeon 0000:01:00.0: [drm] Cannot find any crtc or sizes

i see in lspci, you have two graphics cards, can happens, that after resume going signal to second graphic card?

can you put here dmesg after suspend ?

Re: suspend / resume with .xinitrc

Reply #6
sure, but -- how can i get a dmesg after suspend?

after suspend i must reset/ reboot before i can do something again.

Re: suspend / resume with .xinitrc

Reply #7
sure, but -- how can i get a dmesg after suspend?

after suspend i must reset/ reboot before i can do something again.
ohh, sorry, i forgott  :D  :D

On some systems, turning off the discrete GPU before the X server is initialized may hang the system. In such cases, it may be better to disable the GPU after X server initialization, which is possible with some display managers. https://wiki.archlinux.org/index.php/Hybrid_graphics

do you use both graphics? how switch you between they both? Can you disable one graphics and try suspend?


Re: suspend / resume with .xinitrc

Reply #8
The second card, the "Turks" card, was still built in, but disabled in the BIOS.

I have removed it now and tried again, but it didn't help. BIOS is set to use the CPU (or GPU) graphics. I think the processor has graphic cores.

Re: suspend / resume with .xinitrc

Reply #9
The second card, the "Turks" card, was still built in, but disabled in the BIOS.

I have removed it now and tried again, but it didn't help. BIOS is set to use the CPU (or GPU) graphics. I think the processor has graphic cores.

ok,

can you please install any display manager, run your WM/DE from it and see, if same error?  can be hw error, or maybe after all some missing in your configuration...

Re: suspend / resume with .xinitrc

Reply #10
please put here one log more

Code: [Select]
rc-update show

Re: suspend / resume with .xinitrc

Reply #11
Thank you for your help. I'll try with lightdm. Here the "rc-update show" output:

Code: [Select]
% rc-update show
                acpid |      default                          
          agetty.tty1 |      default                          
          agetty.tty2 |      default                          
          agetty.tty3 |      default                          
          agetty.tty4 |      default                          
          agetty.tty5 |      default                          
          agetty.tty6 |      default                          
         avahi-daemon |      default                          
               binfmt | boot                                  
             bootmisc | boot                                  
              cgroups |                                 sysinit
               cronie |      default                          
                cupsd |      default                          
                 dbus |      default                          
                devfs |                                 sysinit
                dmesg |                                 sysinit
              elogind | boot                                  
                 fsck | boot                                  
             hostname | boot                                  
              hwclock | boot                                  
              keymaps | boot                                  
            killprocs |                        shutdown       
    kmod-static-nodes |                                 sysinit
                local |      default nonetwork                
           localmount | boot                                  
             loopback | boot                                  
              mariadb |      default                          
              modules | boot                                  
             mount-ro |                        shutdown       
                 mtab | boot                                  
               net.lo | boot                                  
             netmount |      default                          
                nginx |      default                          
         opensysusers | boot                                  
     opentmpfiles-dev |                                 sysinit
   opentmpfiles-setup | boot                                  
              php-fpm |      default                          
               procfs | boot                                  
                 root | boot                                  
         save-keymaps | boot                                  
    save-termencoding | boot                                  
            savecache |                        shutdown       
                 swap | boot                                  
               sysctl | boot                                  
                sysfs |                                 sysinit
            syslog-ng |      default                          
         termencoding | boot                                  
                 udev |                                 sysinit
         udev-trigger |                                 sysinit
              urandom | boot

Re: suspend / resume with .xinitrc

Reply #12
Ok, I have executed : "sudo rc-update add xdm" and rebootet and started fvwm.

Both commands, "loginctl suspend" and "loginctl hibernate" shutted down the PC and woke up after pressing a key and brought me back to fvwm. :)

I had decided to try an .xinitrc setup because with xdm/lightdm i can't open my hard disk raid in thunar per click. I believe i need the "dbus-launch" command..  (..like "dbus-launch fvwm")

edit: or maybe i have to make an alias for thunar (dbus-launch thunar). I don't know what is better.

Re: suspend / resume with .xinitrc

Reply #13
I am now using xdm (with lightdm) and have  changed the exec line in "/usr/share/xsessions/fvwm.desktop" from "fvwm" to "dbus-launch fvwm".
Now thunar seems to work right and gajim, for example, too (gajim could not save a password in gnome-keyring without the "dbus-launch").

And: "loginctl suspend" works.  It's no more an .xinitrc setup, but i think I'll leave it that way for now.