Allow specifying output streams.
[nssm.git] / README.txt
index f0270f8..b772c36 100644 (file)
@@ -36,6 +36,14 @@ Thanks François-Régis Tardy.
 Since version 2.15, NSSM is translated into Italian.\r
 Thanks Riccardo Gusmeroli.\r
 \r
+Since version 2.17, NSSM can try to shut down console applications by\r
+simulating a Control-C keypress.  If they have installed a handler routine\r
+they can clean up and shut down gracefully on receipt of the event.\r
+\r
+Since version 2.17, NSSM can redirect the managed application's I/O streams\r
+to an arbitrary path.\r
+\r
+\r
 Usage\r
 -----\r
 In the usage notes below, arguments to the program may be written in angle \r
@@ -129,6 +137,33 @@ request to suicide if you explicitly configure a registry key for exit code 0.
 If only the default action is set to Suicide NSSM will instead exit gracefully.\r
 \r
 \r
+I/O redirection\r
+---------------\r
+NSSM can redirect the managed application's I/O to any path capable of being\r
+opened by CreateFile().  This enables, for example, capturing the log output\r
+of an application which would otherwise only write to the console or accepting\r
+input from a serial port.\r
+\r
+NSSM will look in the registry under\r
+HKLM\SYSTEM\CurrentControlSet\Services\<service>\Parameters for the keys\r
+corresponding to arguments to CreateFile().  All are optional.  If no path is\r
+given for a particular stream it will not be redirected.  If a path is given\r
+but any of the other values are omitted they will be receive sensible defaults.\r
+\r
+  AppStdin: Path to receive input.\r
+  AppStdout: Path to receive output.\r
+  AppStderr: Path to receive error output.\r
+\r
+Parameters for CreateFile() are providing with the "AppStdinShareMode",\r
+"AppStdinCreationDisposition" and "AppStdinFlagsAndAttributes" values (and\r
+analogously for stdout and stderr).\r
+\r
+In general, if you want the service to log its output, set AppStdout and\r
+AppStderr to the same path, eg C:\Users\Public\service.log, and it should\r
+work.  Remember, however, that the path must be accessible to the user\r
+running the service.\r
+\r
+\r
 Removing services using the GUI\r
 -------------------------------\r
 NSSM can also remove services.  Run\r
@@ -198,6 +233,8 @@ Thanks to François-Régis Tardy for French translation.
 Thanks to Emilio Frini for spotting that French was inadvertently set as\r
 the default language when the user's display language was not translated.\r
 Thanks to Riccardo Gusmeroli for Italian translation.\r
+Thanks to Eric Cheldelin for the inspiration to generate a Control-C event\r
+on shutdown.\r
 \r
 Licence\r
 -------\r