From 36750ab900c4dadc21b670c3a47b74b92c97c9e7 Mon Sep 17 00:00:00 2001 From: hagen Date: Tue, 19 Jan 2016 00:00:00 +0000 Subject: [PATCH] * DaemonWin32 : separate --service (boolean) from --svcctl (string) option --- DaemonWin32.cpp | 9 +++------ docs/configuration.md | 1 + 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/DaemonWin32.cpp b/DaemonWin32.cpp index 6e0c46b8..e09bf077 100644 --- a/DaemonWin32.cpp +++ b/DaemonWin32.cpp @@ -23,9 +23,10 @@ namespace i2p else isDaemon = 0; - std::string serviceControl = i2p::util::config::GetArg("-service", "none"); + std::string serviceControl = i2p::util::config::GetArg("-svcctl", ""); if (serviceControl == "install") { + LogPrint(eLogInfo, "WinSVC: installing ", SERVICE_NAME, " as service"); InstallService( SERVICE_NAME, // Name of service SERVICE_DISPLAY_NAME, // Name to display @@ -38,14 +39,10 @@ namespace i2p } else if (serviceControl == "remove") { + LogPrint(eLogInfo, "WinSVC: uninstalling ", SERVICE_NAME, " service"); UninstallService(SERVICE_NAME); exit(0); } - else if (serviceControl != "none") - { - printf(" --service=install to install the service.\n"); - printf(" --service=remove to remove the service.\n"); - } if (isDaemon == 1) { diff --git a/docs/configuration.md b/docs/configuration.md index 150101d4..7181cc4c 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -12,6 +12,7 @@ Command line options * --loglevel= - Log messages above this level (debug, *info, warn, error) * --pidfile= - Where to write pidfile (dont write by default) * --daemon= - Enable or disable daemon mode. 1 for yes, 0 for no. +* --svcctl= - Windows service management (--svcctl="install" or --svcctl="remove") * --service= - 1 if uses system folders (/var/run/i2pd.pid, /var/log/i2pd.log, /var/lib/i2pd). * --v6= - 1 if supports communication through ipv6, off by default * --floodfill= - 1 if router is floodfill, off by default