From ffbbf88de45ec498aca2476b8d285817a23c8124 Mon Sep 17 00:00:00 2001 From: hagen Date: Tue, 12 Jan 2016 23:31:01 +0000 Subject: [PATCH] * DaemonLinux : restore old behaviour: always write pidfile by default, but allow override path --- DaemonLinux.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/DaemonLinux.cpp b/DaemonLinux.cpp index 20cad65e..306fc7ca 100644 --- a/DaemonLinux.cpp +++ b/DaemonLinux.cpp @@ -75,6 +75,10 @@ namespace i2p // Pidfile // this code is c-styled and a bit ugly, but we need fd for locking pidfile pidfile = i2p::util::config::GetArg("-pidfile", ""); + if (pidfile == "") { + pidfile = IsService () ? "/var/run" : i2p::util::filesystem::GetDataDir().string(); + pidfile.append("/i2pd.pid"); + } if (pidfile != "") { pidFH = open(pidfile.c_str(), O_RDWR | O_CREAT, 0600); if (pidFH < 0)