summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSadie Powell <sadie@witchery.services>2025-05-17 20:04:21 +0100
committerSadie Powell <sadie@witchery.services>2025-05-17 20:04:41 +0100
commitcb334fbae1114d407d58429308fb0e983fa3f684 (patch)
treee3b777c40312ed36798c9151af510c657579fa6a
parentd3bb930a5e70dbaacfc42128472b84066f42f5db (diff)
Remove the pidfile before restarting.
Fixes being unable to restart now we only allow one instance.
-rw-r--r--src/main.cpp4
1 files changed, 4 insertions, 0 deletions
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<const Anope::string>("pid"));
+ if (!pidfile.empty())
+ remove(pidfile.c_str());
+
if (chdir(BinaryDir.c_str()) == 0)
{
Anope::string sbin = "./" + Anope::ServicesBin;