mirror of
https://github.com/znc/znc.git
synced 2026-05-18 15:25:53 +02:00
Remove the pid file when ZNC exits
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@948 726aef4b-f618-498e-8847-2d620e286838
This commit is contained in:
@@ -53,6 +53,8 @@ CZNC::~CZNC() {
|
||||
#ifdef _MODULES
|
||||
delete m_pModules;
|
||||
#endif
|
||||
|
||||
DeletePidFile();
|
||||
}
|
||||
|
||||
CString CZNC::GetTag(bool bIncludeVersion) {
|
||||
@@ -263,6 +265,26 @@ bool CZNC::WritePidFile(int iPid) {
|
||||
return false;
|
||||
}
|
||||
|
||||
bool CZNC::DeletePidFile() {
|
||||
if (!m_sPidFile.empty()) {
|
||||
CString sFile;
|
||||
// absolute path or relative to the data dir?
|
||||
if (m_sPidFile[0] != '/')
|
||||
sFile = GetZNCPath() + "/" + m_sPidFile;
|
||||
else
|
||||
sFile = m_sPidFile;
|
||||
|
||||
CFile File(sFile);
|
||||
CUtils::PrintAction("Deleting pid file [" + sFile + "]");
|
||||
if (File.Delete()) {
|
||||
CUtils::PrintStatus(true);
|
||||
return true;
|
||||
}
|
||||
CUtils::PrintStatus(false);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool CZNC::WritePemFile( bool bEncPem ) {
|
||||
#ifndef HAVE_LIBSSL
|
||||
CUtils::PrintError("ZNC was not compiled with ssl support.");
|
||||
|
||||
Reference in New Issue
Block a user