Since version 2.22, NSSM can set the managed application's process priority\r
and CPU affinity.\r
\r
+Since version 2.22, NSSM can apply an unconditional delay before restarting\r
+an application which has exited.\r
+\r
Since version 2.22, NSSM can rotate existing output files when redirecting I/O.\r
\r
Since version 2.22, NSSM can set service display name, description, startup\r
milliseconds as a REG_DWORD value in the registry at\r
HKLM\SYSTEM\CurrentControlSet\Services\<service>\Parameters\AppThrottle.\r
\r
+Alternatively, NSSM can pause for a configurable amount of time before\r
+attempting to restart the application even if it successfully ran for the\r
+amount of time specified by AppThrottle. NSSM will consult the REG_DWORD value\r
+at HKLM\SYSTEM\CurrentControlSet\Services\<service>\Parameters\AppRestartDelay\r
+for the number of milliseconds to wait before attempting a restart. If\r
+AppRestartDelay is set and the application is determined to be subject to\r
+throttling, NSSM will pause the service for whichever is longer of the\r
+configured restart delay and the calculated throttle period.\r
+\r
+If AppRestartDelay is missing or invalid, only throttling will be applied.\r
+\r
NSSM will look in the registry under\r
HKLM\SYSTEM\CurrentControlSet\Services\<service>\Parameters\AppExit for\r
string (REG_EXPAND_SZ) values corresponding to the exit code of the application.\r
timeouts if the application spawns multiple subprocesses.\r
\r
\r
+Console window\r
+--------------\r
+By default, NSSM will create a console window so that applications which\r
+are capable of reading user input can do so - subject to the service being\r
+allowed to interact with the desktop.\r
+\r
+Creation of the console can be suppressed by setting the integer (REG_DWORD)\r
+HKLM\SYSTEM\CurrentControlSet\Services\<service>\Parameters\AppNoConsole\r
+registry value to 1.\r
+\r
+\r
I/O redirection\r
---------------\r
NSSM can redirect the managed application's I/O to any path capable of being\r
They will be rotated regardless of whether NSSM would otherwise have appended\r
or replaced them.\r
\r
+NSSM can also rotate files which hit the configured size threshold while the\r
+service is running. Additionally, you can trigger an on-demand rotation by\r
+running the command\r
+\r
+ nssm rotate <servicename>\r
+\r
+On-demand rotations will happen after the next line of data is read from\r
+the managed application, regardless of the value of AppRotateBytes. Be aware\r
+that if the application is not particularly verbose the rotation may not\r
+happen for some time.\r
+\r
+To enable online and on-demand rotation, set AppRotateOnline to a non-zero\r
+value.\r
+\r
+Note that online rotation requires NSSM to intercept the application's I/O\r
+and create the output files on its behalf. This is more complex and\r
+error-prone than simply redirecting the I/O streams before launching the\r
+application. Therefore online rotation is not enabled by default.\r
+\r
\r
Environment variables\r
---------------------\r
Each entry in the list should be of the form KEY=VALUE. It is possible to\r
omit the VALUE but the = symbol is mandatory.\r
\r
-srvany only supports AppEnvironment.\r
+Environment variables listed in both AppEnvironment and AppEnvironmentExtra\r
+are subject to normal expansion, so it is possible, for example, to update the\r
+system path by setting "PATH=C:\bin;%PATH%" in AppEnvironmentExtra. Variables\r
+are expanded in the order in which they appear, so if you want to include the\r
+value of one variable in another variable you should declare the dependency\r
+first.\r
+\r
+Because variables defined in AppEnvironment override the existing\r
+environment it is not possible to refer to any variables which were previously\r
+defined.\r
+\r
+For example, the following AppEnvironment block:\r
+\r
+ PATH=C:\Windows\System32;C:\Windows\r
+ PATH=C:\bin;%PATH%\r
+\r
+Would result in a PATH of "C:\bin;C:\Windows\System32;C:\Windows" as expected.\r
+\r
+Whereas the following AppEnvironment block:\r
+\r
+ PATH=C:\bin;%PATH%\r
+\r
+Would result in a path containing only C:\bin and probably cause the\r
+application to fail to start.\r
+\r
+Most people will want to use AppEnvironmentExtra exclusively. srvany only\r
+supports AppEnvironment.\r
\r
\r
Managing services using the GUI\r
\r
nssm start <servicename>\r
\r
+ nssm restart <servicename>\r
+\r
nssm stop <servicename>\r
\r
nssm status <servicename>\r
Thanks to Арслан Сайдуганов for suggesting setting process priority.\r
Thanks to Robert Middleton for suggestion and draft implementation of process\r
affinity support.\r
+Thanks to Andrew RedzMax for suggesting an unconditional restart delay.\r
+Thanks to Bryan Senseman for noticing that applications with redirected stdout\r
+and/or stderr which attempt to read from stdin would fail.\r
+Thanks to Czenda Czendov for help with Visual Studio 2013 and Server 2012R2.\r
\r
Licence\r
-------\r