mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-01-22 13:27:17 +01:00
[daemon] print errors to stdout
Signed-off-by: R4SAS <r4sas@i2pmail.org>
This commit is contained in:
parent
34544be423
commit
ab2577ce0a
|
@ -73,6 +73,7 @@ namespace i2p
|
||||||
if (pid < 0) // error
|
if (pid < 0) // error
|
||||||
{
|
{
|
||||||
LogPrint(eLogError, "Daemon: Could not fork: ", strerror(errno));
|
LogPrint(eLogError, "Daemon: Could not fork: ", strerror(errno));
|
||||||
|
std::cerr << "i2pd: Could not fork: " << strerror(errno) << std::endl;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -82,12 +83,14 @@ namespace i2p
|
||||||
if (sid < 0)
|
if (sid < 0)
|
||||||
{
|
{
|
||||||
LogPrint(eLogError, "Daemon: Could not create process group.");
|
LogPrint(eLogError, "Daemon: Could not create process group.");
|
||||||
|
std::cerr << "i2pd: Could not create process group." << std::endl;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
std::string d = i2p::fs::GetDataDir();
|
std::string d = i2p::fs::GetDataDir();
|
||||||
if (chdir(d.c_str()) != 0)
|
if (chdir(d.c_str()) != 0)
|
||||||
{
|
{
|
||||||
LogPrint(eLogError, "Daemon: Could not chdir: ", strerror(errno));
|
LogPrint(eLogError, "Daemon: Could not chdir: ", strerror(errno));
|
||||||
|
std::cerr << "i2pd: Could not chdir: " << strerror(errno) << std::endl;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -144,6 +147,7 @@ namespace i2p
|
||||||
if (pidFH < 0)
|
if (pidFH < 0)
|
||||||
{
|
{
|
||||||
LogPrint(eLogError, "Daemon: Could not create pid file ", pidfile, ": ", strerror(errno));
|
LogPrint(eLogError, "Daemon: Could not create pid file ", pidfile, ": ", strerror(errno));
|
||||||
|
std::cerr << "i2pd: Could not create pid file " << pidfile << ": " << strerror(errno) << std::endl;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -151,6 +155,7 @@ namespace i2p
|
||||||
if (lockf(pidFH, F_TLOCK, 0) != 0)
|
if (lockf(pidFH, F_TLOCK, 0) != 0)
|
||||||
{
|
{
|
||||||
LogPrint(eLogError, "Daemon: Could not lock pid file ", pidfile, ": ", strerror(errno));
|
LogPrint(eLogError, "Daemon: Could not lock pid file ", pidfile, ": ", strerror(errno));
|
||||||
|
std::cerr << "i2pd: Could not lock pid file " << pidfile << ": " << strerror(errno) << std::endl;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -159,7 +164,8 @@ namespace i2p
|
||||||
ftruncate(pidFH, 0);
|
ftruncate(pidFH, 0);
|
||||||
if (write(pidFH, pid, strlen(pid)) < 0)
|
if (write(pidFH, pid, strlen(pid)) < 0)
|
||||||
{
|
{
|
||||||
LogPrint(eLogError, "Daemon: Could not write pidfile: ", strerror(errno));
|
LogPrint(eLogError, "Daemon: Could not write pidfile ", pidfile, ": ", strerror(errno));
|
||||||
|
std::cerr << "i2pd: Could not write pidfile " << pidfile << ": " << strerror(errno) << std::endl;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue