diff --git a/src/init.cpp b/src/init.cpp index 3881d92e8..8bf7d387c 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -211,7 +211,9 @@ static void InitSignals() static void remove_pidfile() { - remove(Config->GetBlock("serverinfo")->Get("pid").c_str()); + auto pidfile = Anope::ExpandData(Config->GetBlock("serverinfo")->Get("pid")); + if (!pidfile.empty()) + remove(pidfile.c_str()); } /* Create our PID file and write the PID to it. */