mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-04-18 23:16:37 +02:00
* DaemonLinux : restore old behaviour: always write pidfile by default, but allow override path
This commit is contained in:
parent
e2ff49825f
commit
ffbbf88de4
1 changed files with 4 additions and 0 deletions
|
@ -75,6 +75,10 @@ namespace i2p
|
||||||
// Pidfile
|
// Pidfile
|
||||||
// this code is c-styled and a bit ugly, but we need fd for locking pidfile
|
// this code is c-styled and a bit ugly, but we need fd for locking pidfile
|
||||||
pidfile = i2p::util::config::GetArg("-pidfile", "");
|
pidfile = i2p::util::config::GetArg("-pidfile", "");
|
||||||
|
if (pidfile == "") {
|
||||||
|
pidfile = IsService () ? "/var/run" : i2p::util::filesystem::GetDataDir().string();
|
||||||
|
pidfile.append("/i2pd.pid");
|
||||||
|
}
|
||||||
if (pidfile != "") {
|
if (pidfile != "") {
|
||||||
pidFH = open(pidfile.c_str(), O_RDWR | O_CREAT, 0600);
|
pidFH = open(pidfile.c_str(), O_RDWR | O_CREAT, 0600);
|
||||||
if (pidFH < 0)
|
if (pidFH < 0)
|
||||||
|
|
Loading…
Add table
Reference in a new issue