mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-04-28 11:47:48 +02:00
use system folders if run as service
This commit is contained in:
parent
2cd8d0c0b7
commit
02c51b0980
5 changed files with 18 additions and 5 deletions
14
Daemon.cpp
14
Daemon.cpp
|
@ -39,6 +39,14 @@ namespace i2p
|
|||
delete &d;
|
||||
};
|
||||
|
||||
bool Daemon_Singleton::IsService () const
|
||||
{
|
||||
#ifndef _WIN32
|
||||
return i2p::util::config::GetArg("-service", 0);
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
bool Daemon_Singleton::init(int argc, char* argv[])
|
||||
{
|
||||
|
@ -76,11 +84,11 @@ namespace i2p
|
|||
{
|
||||
if (isDaemon)
|
||||
{
|
||||
std::string logfile_path = i2p::util::filesystem::GetDataDir().string();
|
||||
std::string logfile_path = IsService () ? "/var/log" : i2p::util::filesystem::GetDataDir().string();
|
||||
#ifndef _WIN32
|
||||
logfile_path.append("/debug.log");
|
||||
logfile_path.append("/i2pd.log");
|
||||
#else
|
||||
logfile_path.append("\\debug.log");
|
||||
logfile_path.append("\\i2pd.log");
|
||||
#endif
|
||||
StartLog (logfile_path);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue