Closed amano-kenji closed 1 year ago
This seems to be xwayland issue.
Reopening because this issue started after upgrading emptty to 0.11.0
Can you, please, provide more info about your configuration? Because changes between v0.10.0 and v0.11.0 are mostly superficial. Couldn't it be related to #92, where was a change in OpenRC service requested?
edit: Does it happens also in case of running emptty as root?
UID PID PPID C STIME TTY STAT TIME CMD
root 3280 19914 0 10:08 tty7 Ssl+ 0:00 /usr/bin/emptty -d
emptty is already running as root. I think the change to openrc init file could be the cause of the issue. I will investigate.
Adding
EMPTTY_TERMTIMEOUT=${EMPTTY_TERMTIMEOUT:-"TERM/60/KILL/15"}
retry="${EMPTTY_TERMTIMEOUT}"
to openrc init script merely shed a light on the real issue.
If ~/.config/emptty is
#!/bin/bash
Selection=true
xrdb -merge ~/.Xresources
. /etc/profile
. ~/.env
dinit &
"$@"
dinitctl shutdown
emptty fails to kill ~/.config/emptty sway
. If ~/.config/emptty is
#!/bin/bash
Selection=true
xrdb -merge ~/.Xresources
. /etc/profile
. ~/.env
exec "$@"
emptty can kill ~/.config/emptty sway
immediately. Thus, I need a way to properly shut down ~/.config/emptty
without losing the part that handles dinit.
Seems like any script after starting a desktop (even with Xorg) causes the same issue (e.g. logout from Openbox). Maybe some kind of user exit script would do the thing, if I can't find another solution.
If ~/.config/emptty
is a shell script, then the last statement should be exec "$@"
. Otherwise, emptty fails to kill ~/.config/emptty
.
I see two options.
dinitctl shutdown
to my own scripts executed by keyboard shortcuts.Currently there is already DISPLAY_STOP_SCRIPT
, however it's started out of user's session as root
. So I don't think this would help you. Custom script run by keyboard shortcuts wouldn't handle service termination, so it looks like user exit script is the only way. Also this script should have some short timeout, before it is also terminated (to avoid longer than usual situations).
These scripts seem to be able to reboot and power off my computer inside a sway session in response to sway keyboard shortcuts.
my-sway-reboot
#!/bin/sh
dinitctl shutdown
sudo my-reboot
my-sway-poweroff
#!/bin/sh
dinitctl shutdown
sudo my-poweroff
sudo my-reboot
and sudo my-poweroff
are executed without password.
Because ~/.config/emptty
looks like
#!/bin/bash
Selection=true
xrdb -merge ~/.Xresources
. /etc/profile
. ~/.env
dinit &
exec "$@"
openrc can quickly kill emptty along with ~/.config/emptty sway
.
I've meant emptty
service termination, e.g. by rc-service emptty stop
.
If you want to implement user exit script, I want to be able to configure timeout for the script, or it should be a sensible value like 30 seconds.
I'm thinking about this implementation:
~/.config/emptty-exit
file~/.config/emptty
it will be shell script with variables, that will be read before execution.TIMEOUT
or something like thatTIMEOUT
), if timeout is defined then it will be set, otherwise it will use some short one (5 seconds should be sufficient by default)I think that's good enough.
The file size of ~/core is about 51 megabytes.