From cb334fbae1114d407d58429308fb0e983fa3f684 Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Sat, 17 May 2025 20:04:21 +0100 Subject: [PATCH] Remove the pidfile before restarting. Fixes being unable to restart now we only allow one instance. --- src/main.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main.cpp b/src/main.cpp index 5fed69345..283d7146e 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -217,6 +217,10 @@ int main(int ac, char **av, char **envp) if (Anope::Restarting) { + auto pidfile = Anope::ExpandData(Config->GetBlock("serverinfo").Get("pid")); + if (!pidfile.empty()) + remove(pidfile.c_str()); + if (chdir(BinaryDir.c_str()) == 0) { Anope::string sbin = "./" + Anope::ServicesBin;