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