From 4664245b8b367f6fd626b73b18100abd29be140c Mon Sep 17 00:00:00 2001 From: Juerd Waalboer Date: Thu, 2 Nov 2023 02:51:32 +0100 Subject: [PATCH] Add plugin 'sighup' --- plugins/sighup | 8 ++++++++ revbank.plugins | 3 ++- 2 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 plugins/sighup diff --git a/plugins/sighup b/plugins/sighup new file mode 100644 index 0000000..d0b45a3 --- /dev/null +++ b/plugins/sighup @@ -0,0 +1,8 @@ +# Attempt to restart on SIGHUP + +$SIG{HUP} = sub { + call_hooks("restart_exec"); + no warnings qw(exec); + exec $0; + call_hooks("restart_survived"); +}; diff --git a/revbank.plugins b/revbank.plugins index bca5043..f60156e 100644 --- a/revbank.plugins +++ b/revbank.plugins @@ -9,9 +9,10 @@ beep_terminal #cash_drawer idle #json -restart repeat deduplicate # wants to be after 'repeat' +restart +sighup sigint #stock #vat # configure before using