How to restart x11/StumpWM from a different tty.

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

How to restart x11/StumpWM from a different tty.

Eric Ihli
Sometimes my graphic environment locks up. I think this is a StumpWM issue since my keyboard and mouse continue to "work". I can move the mouse around and switch to a different tty using ctrl-alt-f<n>. But nothing works in the tty where I ran `startx`.

What can be done from a different tty to troubleshoot/fix the issue? I've tried `stumpish` from another tty but I get the error `xprop: unable to open display`.

Other possibly relevant info is that my `.xinitrc` launches StumpWM with `dbus-launch --with-exit-session --sh-syntax stumpwm`.

Thanks,
Eric
Reply | Threaded
Open this post in threaded view
|

Re: How to restart x11/StumpWM from a different tty.

Ram Krishnan
I've had moderate luck connecting via emacsclient and using slime to poke around stumpwm's state. This does require emacs to be running, listening on a server port and for stumpwm itself to accept slime connections.

Cheers,

-ram

Eric Ihli <[hidden email]> writes:

> Sometimes my graphic environment locks up. I think this is a StumpWM issue
> since my keyboard and mouse continue to "work". I can move the mouse around
> and switch to a different tty using ctrl-alt-f<n>. But nothing works in the
> tty where I ran `startx`.
>
> What can be done from a different tty to troubleshoot/fix the issue? I've
> tried `stumpish` from another tty but I get the error `xprop: unable to
> open display`.
>
> Other possibly relevant info is that my `.xinitrc` launches StumpWM with
> `dbus-launch --with-exit-session --sh-syntax stumpwm`.
>
> Thanks,
> Eric


Reply | Threaded
Open this post in threaded view
|

Re: How to restart x11/StumpWM from a different tty.

Lionel Flandrin-4
In reply to this post by Eric Ihli
You can set the DISPLAY environment variable to connect to X from any terminal. In bash/zsh this should do the trick:

export DISPLAY=:0

Then your commands will work.

I have a dirty trick to handle WM crashes: instead of starting the stumpwm binary directly I use a shell script that does something like:

while [ ! -f /tmp/stopstump ]
do
     stumpwm
     sleep 1
done

This way if stumpwm crashes or freeze and I have have to kill it it's restarted automatically without killing my X session and running programs. If I really want to quit the WM and end the session I have to "touch /tmp/stopstump" first.

A bit ugly, but it served me well.

--
Lionel Flandrin


‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
On Tuesday, April 7, 2020 6:58 PM, Eric Ihli <[hidden email]> wrote:

Sometimes my graphic environment locks up. I think this is a StumpWM issue since my keyboard and mouse continue to "work". I can move the mouse around and switch to a different tty using ctrl-alt-f<n>. But nothing works in the tty where I ran `startx`.

What can be done from a different tty to troubleshoot/fix the issue? I've tried `stumpish` from another tty but I get the error `xprop: unable to open display`.

Other possibly relevant info is that my `.xinitrc` launches StumpWM with `dbus-launch --with-exit-session --sh-syntax stumpwm`.

Thanks,
Eric

Reply | Threaded
Open this post in threaded view
|

Re: How to restart x11/StumpWM from a different tty.

Eric S Fraga
On Tuesday,  7 Apr 2020 at 18:58, Lionel Flandrin wrote:
> I have a dirty trick to handle WM crashes: instead of starting the
> stumpwm binary directly I use a shell script that does something like:

Thank you for this.  Quite helpful as I've been having quite a few
stumpwm crashes lately.  I'm using stumpwm from Debian bullseye as I
have not found the time to compile my own with the latest versions...

--
Eric S Fraga via Emacs 28.0.50 & org 9.3.6 on Debian bullseye/sid


Reply | Threaded
Open this post in threaded view
|

Re: How to restart x11/StumpWM from a different tty.

Stefan Reichör
In reply to this post by Lionel Flandrin-4
Hi Lionel,

> You can set the DISPLAY environment variable to connect to X from any
> terminal. In bash/zsh this should do the trick:
>
> export DISPLAY=:0
>
> Then your commands will work.
>
> I have a dirty trick to handle WM crashes: instead of starting the
> stumpwm binary directly I use a shell script that does something
> like:
>
> while [ ! -f /tmp/stopstump ]
> do
>      stumpwm
>      sleep 1
> done
>
> This way if stumpwm crashes or freeze and I have have to kill it it's
> restarted automatically without killing my X session and running
> programs. If I really want to quit the WM and end the session I have
> to "touch /tmp/stopstump" first.
>
> A bit ugly, but it served me well.
>
> --
> Lionel Flandrin

That is a really nice idea. I was already using some tmux sessions that survived a stumpwm crash.
I remembered a tool that will do the restart of a crashed application: daemontools

 - http://cr.yp.to/daemontools.html
 - daemontools is a collection of tools for managing UNIX services.
 - supervise monitors a service. It starts the service and restarts the service if it dies. Setting up a new service is easy: all supervise needs is a directory with a run script that runs the service.

# apt-get install daemontools

Now I use daemontools to restart stumpwm when it crashes. Perhaps this
is useful for somebody else as well:


Content of ~/supervise/stumpwm/run
<example>
#!/bin/sh
/home/stefan/prg/bin/stumpwm
</example>

* Run stumpwm through supervise
 # supervise /home/stefan/supervise/stumpwm
 # svstat ~/supervise/stumpwm
/home/stefan/supervise/stumpwm: up (pid 32536) 238 seconds
 - Restart stumpwm
   # killall stumpwm
     - 'svc -k ~/supervise/stumpwm' does not work since it only kills the script.
       Not sure why - perhaps because the script is restarted and exits since the window manager is already running
 - Quit stumpwm to get back to the login manager (-x ... tell supervise to stop when stumpwm exits, -t ... send sigterm to stumpwm)
   # svc -x ~/supervise/stumpwm
   # svc -t ~/supervise/stumpwm
* Show status of my running supervised tools
  # svstat ~/supervise/*


Stefan.

>
> ‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
> On Tuesday, April 7, 2020 6:58 PM, Eric Ihli <[hidden email]> wrote:
>
>
>     Sometimes my graphic environment locks up. I think this is a
>     StumpWM issue since my keyboard and mouse continue to "work". I
>     can move the mouse around and switch to a different tty using
>     ctrl-alt-f<n>. But nothing works in the tty where I ran `startx`.
>    
>     What can be done from a different tty to troubleshoot/fix the
>     issue? I've tried `stumpish` from another tty but I get the error
>     `xprop: unable to open display`.
>    
>     Other possibly relevant info is that my `.xinitrc` launches
>     StumpWM with `dbus-launch --with-exit-session --sh-syntax stumpwm
>     `.
>    
>     Thanks,
>     Eric

Reply | Threaded
Open this post in threaded view
|

Re: How to restart x11/StumpWM from a different tty.

Lionel Flandrin-4
In reply to this post by Lionel Flandrin-4
By the way, if you use a similar script you probably want to add a "rm -f /tmp/stopstump" before the while loop, otherwise you won't manage to restart the WM if you use a login manager since the script will quit immediately. I noticed that the hard way...

--
Lionel Flandrin


‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
On Tuesday, April 7, 2020 7:58 PM, Lionel Flandrin <[hidden email]> wrote:

You can set the DISPLAY environment variable to connect to X from any terminal. In bash/zsh this should do the trick:

export DISPLAY=:0

Then your commands will work.

I have a dirty trick to handle WM crashes: instead of starting the stumpwm binary directly I use a shell script that does something like:

while [ ! -f /tmp/stopstump ]
do
     stumpwm
     sleep 1
done

This way if stumpwm crashes or freeze and I have have to kill it it's restarted automatically without killing my X session and running programs. If I really want to quit the WM and end the session I have to "touch /tmp/stopstump" first.

A bit ugly, but it served me well.

--
Lionel Flandrin


‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
On Tuesday, April 7, 2020 6:58 PM, Eric Ihli <[hidden email]> wrote:

Sometimes my graphic environment locks up. I think this is a StumpWM issue since my keyboard and mouse continue to "work". I can move the mouse around and switch to a different tty using ctrl-alt-f<n>. But nothing works in the tty where I ran `startx`.

What can be done from a different tty to troubleshoot/fix the issue? I've tried `stumpish` from another tty but I get the error `xprop: unable to open display`.

Other possibly relevant info is that my `.xinitrc` launches StumpWM with `dbus-launch --with-exit-session --sh-syntax stumpwm`.

Thanks,
Eric