Server sigterm/shutdown hook

13 views
Skip to first unread message

Birger Möllering

unread,
Aug 1, 2019, 3:44:34 PM8/1/19
to tmux-...@googlegroups.com
Hello dear tmux developers,

as of recently i am using tmux and am very satisfied with it
and grateful for your great effort.

However there is a minor feature i would like to have,
you might be able to help me with.

I would like to save the tmux sessions automatically
on shutdown with tmux-resurrect, wich might be possible,
by trapping sigterm.
I am not sure though, how processes are killed on shutdown.
(do parents kill their subprocesses ... or are they killed in short order)

Is there a way to do so with tmux ?
How hard would it be to implement a before-server-close hook ?

Best bmoe

Nicholas Marriott

unread,
Aug 5, 2019, 2:45:01 AM8/5/19
to Birger Möllering, tmux-users
There is no hook for SIGTERM at the moment, I'm not sure how hard it
would be to add one, destroying the sessions would need to be moved to
the command queue because otherwise there would be no point (the hook
would fire after the sessions were destroyed). Look at
server.c:server_send_exit and server_signal.
> --
> You received this message because you are subscribed to the Google Groups "tmux-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to tmux-users+...@googlegroups.com.
> To view this discussion on the web, visit https://groups.google.com/d/msgid/tmux-users/CAKfFzEdvjN21pJ-hGDEvWkYUXgWUgf%3Dk-dG7EioLDUu%2Bwk32EQ%40mail.gmail.com.
Reply all
Reply to author
Forward
0 new messages