From e629f4ff9bc20bef4313b9f983a808e0b1e380c4 Mon Sep 17 00:00:00 2001 From: ellie timoney Date: Fri, 11 Oct 2024 11:49:53 +1100 Subject: [PATCH 1/2] WIP Instance: kill fakesmtpd with QUIT rather than TERM this activates Net::Server's graceful shutdown mode which might do a better job of not sometimes leaving stuff listening on the port?? --- cassandane/Cassandane/Instance.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cassandane/Cassandane/Instance.pm b/cassandane/Cassandane/Instance.pm index fb1fda570a..36e53b40c5 100644 --- a/cassandane/Cassandane/Instance.pm +++ b/cassandane/Cassandane/Instance.pm @@ -1118,7 +1118,7 @@ sub _start_smtpd local *__ANON__ = "kill_smtpd"; my $self = shift; xlog "killing fakesmtpd $smtppid"; - kill(15, $smtppid); + kill('QUIT', $smtppid); $self->reap_command($smtppid); }; } From 7f28a3291c516ffb305fe4d901d075bf981674ee Mon Sep 17 00:00:00 2001 From: ellie timoney Date: Fri, 11 Oct 2024 11:52:01 +1100 Subject: [PATCH 2/2] WIP fakesmtpd: server->run never returns (calls exit itself) --- cassandane/utils/fakesmtpd | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cassandane/utils/fakesmtpd b/cassandane/utils/fakesmtpd index 0a48026d54..fa07035502 100755 --- a/cassandane/utils/fakesmtpd +++ b/cassandane/utils/fakesmtpd @@ -35,5 +35,5 @@ my $smtpd = Cassandane::Net::SMTPServer->new({ store_msg => 1, messages_dir => "$basedir/smtpd/", }); -$smtpd->run() or die; -exit 0; # Never reached + +$smtpd->run(); # never returns (calls exit itself)