README.txt 27 KB

  1. NSSM: The Non-Sucking Service Manager
  2. Version 2.21, 2013-11-24
  3. NSSM is a service helper program similar to srvany and cygrunsrv. It can
  4. start any application as an NT service and will restart the service if it
  5. fails for any reason.
  6. NSSM also has a graphical service installer and remover.
  7. Full documentation can be found online at
  9. Since version 2.0, the GUI can be bypassed by entering all appropriate
  10. options on the command line.
  11. Since version 2.1, NSSM can be compiled for x64 platforms.
  12. Thanks Benjamin Mayrargue.
  13. Since version 2.2, NSSM can be configured to take different actions
  14. based on the exit code of the managed application.
  15. Since version 2.3, NSSM logs to the Windows event log more elegantly.
  16. Since version 2.5, NSSM respects environment variables in its parameters.
  17. Since version 2.8, NSSM tries harder to shut down the managed application
  18. gracefully and throttles restart attempts if the application doesn't run
  19. for a minimum amount of time.
  20. Since version 2.11, NSSM respects srvany's AppEnvironment parameter.
  21. Since version 2.13, NSSM is translated into French.
  22. Thanks François-Régis Tardy.
  23. Since version 2.15, NSSM is translated into Italian.
  24. Thanks Riccardo Gusmeroli.
  25. Since version 2.17, NSSM can try to shut down console applications by
  26. simulating a Control-C keypress. If they have installed a handler routine
  27. they can clean up and shut down gracefully on receipt of the event.
  28. Since version 2.17, NSSM can redirect the managed application's I/O streams
  29. to an arbitrary path.
  30. Since version 2.18, NSSM can be configured to wait a user-specified amount
  31. of time for the application to exit when shutting down.
  32. Since version 2.19, many more service options can be configured with the
  33. GUI installer as well as via the registry.
  34. Since version 2.19, NSSM can add to the service's environment by setting
  35. AppEnvironmentExtra in place of or in addition to the srvany-compatible
  36. AppEnvironment.
  37. Since version 2.22, NSSM can set the managed application's process priority
  38. and CPU affinity.
  39. Since version 2.22, NSSM can apply an unconditional delay before restarting
  40. an application which has exited.
  41. Since version 2.22, NSSM can rotate existing output files when redirecting I/O.
  42. Since version 2.22, NSSM can set service display name, description, startup
  43. type, log on details and dependencies.
  44. Since version 2.22, NSSM can manage existing services.
  45. Usage
  46. -----
  47. In the usage notes below, arguments to the program may be written in angle
  48. brackets and/or square brackets. <string> means you must insert the
  49. appropriate string and [<string>] means the string is optional. See the
  50. examples below...
  51. Note that everywhere <servicename> appears you may substitute the
  52. service's display name.
  53. Installation using the GUI
  54. --------------------------
  55. To install a service, run
  56. nssm install <servicename>
  57. You will be prompted to enter the full path to the application you wish
  58. to run and any command line options to pass to that application.
  59. Use the system service manager (services.msc) to control advanced service
  60. properties such as startup method and desktop interaction. NSSM may
  61. support these options at a later time...
  62. Installation using the command line
  63. -----------------------------------
  64. To install a service, run
  65. nssm install <servicename> <application> [<options>]
  66. NSSM will then attempt to install a service which runs the named application
  67. with the given options (if you specified any).
  68. Don't forget to enclose paths in "quotes" if they contain spaces!
  69. If you want to include quotes in the options you will need to """quote""" the
  71. Managing the service
  72. --------------------
  73. NSSM will launch the application listed in the registry when you send it a
  74. start signal and will terminate it when you send a stop signal. So far, so
  75. much like srvany. But NSSM is the Non-Sucking service manager and can take
  76. action if/when the application dies.
  77. With no configuration from you, NSSM will try to restart itself if it notices
  78. that the application died but you didn't send it a stop signal. NSSM will
  79. keep trying, pausing between each attempt, until the service is successfully
  80. started or you send it a stop signal.
  81. NSSM will pause an increasingly longer time between subsequent restart attempts
  82. if the service fails to start in a timely manner, up to a maximum of four
  83. minutes. This is so it does not consume an excessive amount of CPU time trying
  84. to start a failed application over and over again. If you identify the cause
  85. of the failure and don't want to wait you can use the Windows service console
  86. (where the service will be shown in Paused state) to send a continue signal to
  87. NSSM and it will retry within a few seconds.
  88. By default, NSSM defines "a timely manner" to be within 1500 milliseconds.
  89. You can change the threshold for the service by setting the number of
  90. milliseconds as a REG_DWORD value in the registry at
  91. HKLM\SYSTEM\CurrentControlSet\Services\<service>\Parameters\AppThrottle.
  92. Alternatively, NSSM can pause for a configurable amount of time before
  93. attempting to restart the application even if it successfully ran for the
  94. amount of time specified by AppThrottle. NSSM will consult the REG_DWORD value
  95. at HKLM\SYSTEM\CurrentControlSet\Services\<service>\Parameters\AppRestartDelay
  96. for the number of milliseconds to wait before attempting a restart. If
  97. AppRestartDelay is set and the application is determined to be subject to
  98. throttling, NSSM will pause the service for whichever is longer of the
  99. configured restart delay and the calculated throttle period.
  100. If AppRestartDelay is missing or invalid, only throttling will be applied.
  101. NSSM will look in the registry under
  102. HKLM\SYSTEM\CurrentControlSet\Services\<service>\Parameters\AppExit for
  103. string (REG_EXPAND_SZ) values corresponding to the exit code of the application.
  104. If the application exited with code 1, for instance, NSSM will look for a
  105. string value under AppExit called "1" or, if it does not find it, will
  106. fall back to the AppExit (Default) value. You can find out the exit code
  107. for the application by consulting the system event log. NSSM will log the
  108. exit code when the application exits.
  109. Based on the data found in the registry, NSSM will take one of three actions:
  110. If the value data is "Restart" NSSM will try to restart the application as
  111. described above. This is its default behaviour.
  112. If the value data is "Ignore" NSSM will not try to restart the application
  113. but will continue running itself. This emulates the (usually undesirable)
  114. behaviour of srvany. The Windows Services console would show the service
  115. as still running even though the application has exited.
  116. If the value data is "Exit" NSSM will exit gracefully. The Windows Services
  117. console would show the service as stopped. If you wish to provide
  118. finer-grained control over service recovery you should use this code and
  119. edit the failure action manually. Please note that Windows versions prior
  120. to Vista will not consider such an exit to be a failure. On older versions
  121. of Windows you should use "Suicide" instead.
  122. If the value data is "Suicide" NSSM will simulate a crash and exit without
  123. informing the service manager. This option should only be used for
  124. pre-Vista systems where you wish to apply a service recovery action. Note
  125. that if the monitored application exits with code 0, NSSM will only honour a
  126. request to suicide if you explicitly configure a registry key for exit code 0.
  127. If only the default action is set to Suicide NSSM will instead exit gracefully.
  128. Application priority
  129. --------------------
  130. NSSM can set the priority class of the managed application. NSSM will look in
  131. the registry under HKLM\SYSTEM\CurrentControlSet\Services\<service>\Parameters
  132. for the REG_DWORD entry AppPriority. Valid values correspond to arguments to
  133. SetPriorityClass(). If AppPriority() is missing or invalid the
  134. application will be launched with normal priority.
  135. Processor affinity
  136. ------------------
  137. NSSM can set the CPU affinity of the managed application. NSSM will look in
  138. the registry under HKLM\SYSTEM\CurrentControlSet\Services\<service>\Parameters
  139. for the REG_SZ entry AppAffinity. It should specify a comma-separated listed
  140. of zero-indexed processor IDs. A range of processors may optionally be
  141. specified with a dash. No other characters are allowed in the string.
  142. For example, to specify the first; second; third and fifth CPUs, an appropriate
  143. AppAffinity would be 0-2,4.
  144. If AppAffinity is missing or invalid, NSSM will not attempt to restrict the
  145. application to specific CPUs.
  146. Note that the 64-bit version of NSSM can configure a maximum of 64 CPUs in this
  147. way and that the 32-bit version can configure a maxium of 32 CPUs even when
  148. running on 64-bit Windows.
  149. Stopping the service
  150. --------------------
  151. When stopping a service NSSM will attempt several different methods of killing
  152. the monitored application, each of which can be disabled if necessary.
  153. First NSSM will attempt to generate a Control-C event and send it to the
  154. application's console. Batch scripts or console applications may intercept
  155. the event and shut themselves down gracefully. GUI applications do not have
  156. consoles and will not respond to this method.
  157. Secondly NSSM will enumerate all windows created by the application and send
  158. them a WM_CLOSE message, requesting a graceful exit.
  159. Thirdly NSSM will enumerate all threads created by the application and send
  160. them a WM_QUIT message, requesting a graceful exit. Not all applications'
  161. threads have message queues; those which do not will not respond to this
  162. method.
  163. Finally NSSM will call TerminateProcess() to request that the operating
  164. system forcibly terminate the application. TerminateProcess() cannot be
  165. trapped or ignored, so in most circumstances the application will be killed.
  166. However, there is no guarantee that it will have a chance to perform any
  167. tidyup operations before it exits.
  168. Any or all of the methods above may be disabled. NSSM will look for the
  169. HKLM\SYSTEM\CurrentControlSet\Services\<service>\Parameters\AppStopMethodSkip
  170. registry value which should be of type REG_DWORD set to a bit field describing
  171. which methods should not be applied.
  172. If AppStopMethodSkip includes 1, Control-C events will not be generated.
  173. If AppStopMethodSkip includes 2, WM_CLOSE messages will not be posted.
  174. If AppStopMethodSkip includes 4, WM_QUIT messages will not be posted.
  175. If AppStopMethodSkip includes 8, TerminateProcess() will not be called.
  176. If, for example, you knew that an application did not respond to Control-C
  177. events and did not have a thread message queue, you could set AppStopMethodSkip
  178. to 5 and NSSM would not attempt to use those methods to stop the application.
  179. Take great care when including 8 in the value of AppStopMethodSkip. If NSSM
  180. does not call TerminateProcess() it is possible that the application will not
  181. exit when the service stops.
  182. By default NSSM will allow processes 1500ms to respond to each of the methods
  183. described above before proceeding to the next one. The timeout can be
  184. configured on a per-method basis by creating REG_DWORD entries in the
  185. registry under HKLM\SYSTEM\CurrentControlSet\Services\<service>\Parameters.
  186. AppStopMethodConsole
  187. AppStopMethodWindow
  188. AppStopMethodThreads
  189. Each value should be set to the number of milliseconds to wait. Please note
  190. that the timeout applies to each process in the application's process tree,
  191. so the actual time to shutdown may be longer than the sum of all configured
  192. timeouts if the application spawns multiple subprocesses.
  193. Console window
  194. --------------
  195. By default, NSSM will create a console window so that applications which
  196. are capable of reading user input can do so - subject to the service being
  197. allowed to interact with the desktop.
  198. Creation of the console can be suppressed by setting the integer (REG_DWORD)
  199. HKLM\SYSTEM\CurrentControlSet\Services\<service>\Parameters\AppNoConsole
  200. registry value to 1.
  201. I/O redirection
  202. ---------------
  203. NSSM can redirect the managed application's I/O to any path capable of being
  204. opened by CreateFile(). This enables, for example, capturing the log output
  205. of an application which would otherwise only write to the console or accepting
  206. input from a serial port.
  207. NSSM will look in the registry under
  208. HKLM\SYSTEM\CurrentControlSet\Services\<service>\Parameters for the keys
  209. corresponding to arguments to CreateFile(). All are optional. If no path is
  210. given for a particular stream it will not be redirected. If a path is given
  211. but any of the other values are omitted they will be receive sensible defaults.
  212. AppStdin: Path to receive input.
  213. AppStdout: Path to receive output.
  214. AppStderr: Path to receive error output.
  215. Parameters for CreateFile() are providing with the "AppStdinShareMode",
  216. "AppStdinCreationDisposition" and "AppStdinFlagsAndAttributes" values (and
  217. analogously for stdout and stderr).
  218. In general, if you want the service to log its output, set AppStdout and
  219. AppStderr to the same path, eg C:\Users\Public\service.log, and it should
  220. work. Remember, however, that the path must be accessible to the user
  221. running the service.
  222. File rotation
  223. -------------
  224. When using I/O redirection, NSSM can rotate existing output files prior to
  225. opening stdout and/or stderr. An existing file will be renamed with a
  226. suffix based on the file's last write time, to millisecond precision. For
  227. example, the file nssm.log might be rotated to nssm-20131221T113939.457.log.
  228. NSSM will look in the registry under
  229. HKLM\SYSTEM\CurrentControlSet\Services\<service>\Parameters for REG_DWORD
  230. entries which control how rotation happens.
  231. If AppRotateFiles is missing or set to 0, rotation is disabled. Any non-zero
  232. value enables rotation.
  233. If AppRotateSeconds is non-zero, a file will not be rotated if its last write
  234. time is less than the given number of seconds in the past.
  235. If AppRotateBytes is non-zero, a file will not be rotated if it is smaller
  236. than the given number of bytes. 64-bit file sizes can be handled by setting
  237. a non-zero value of AppRotateBytesHigh.
  238. Rotation is independent of the CreateFile() parameters used to open the files.
  239. They will be rotated regardless of whether NSSM would otherwise have appended
  240. or replaced them.
  241. NSSM can also rotate files which hit the configured size threshold while the
  242. service is running. Additionally, you can trigger an on-demand rotation by
  243. running the command
  244. nssm rotate <servicename>
  245. On-demand rotations will happen after the next line of data is read from
  246. the managed application, regardless of the value of AppRotateBytes. Be aware
  247. that if the application is not particularly verbose the rotation may not
  248. happen for some time.
  249. To enable online and on-demand rotation, set AppRotateOnline to a non-zero
  250. value.
  251. Note that online rotation requires NSSM to intercept the application's I/O
  252. and create the output files on its behalf. This is more complex and
  253. error-prone than simply redirecting the I/O streams before launching the
  254. application. Therefore online rotation is not enabled by default.
  255. Environment variables
  256. ---------------------
  257. NSSM can replace or append to the managed application's environment. Two
  258. multi-valued string (REG_MULTI_SZ) registry values are recognised under
  259. HKLM\SYSTEM\CurrentControlSet\Services\<service>\Parameters.
  260. AppEnvironment defines a list of environment variables which will override
  261. the service's environment. AppEnvironmentExtra defines a list of
  262. environment variables which will be added to the service's environment.
  263. Each entry in the list should be of the form KEY=VALUE. It is possible to
  264. omit the VALUE but the = symbol is mandatory.
  265. Environment variables listed in both AppEnvironment and AppEnvironmentExtra
  266. are subject to normal expansion, so it is possible, for example, to update the
  267. system path by setting "PATH=C:\bin;%PATH%" in AppEnvironmentExtra. Variables
  268. are expanded in the order in which they appear, so if you want to include the
  269. value of one variable in another variable you should declare the dependency
  270. first.
  271. Because variables defined in AppEnvironment override the existing
  272. environment it is not possible to refer to any variables which were previously
  273. defined.
  274. For example, the following AppEnvironment block:
  275. PATH=C:\Windows\System32;C:\Windows
  276. PATH=C:\bin;%PATH%
  277. Would result in a PATH of "C:\bin;C:\Windows\System32;C:\Windows" as expected.
  278. Whereas the following AppEnvironment block:
  279. PATH=C:\bin;%PATH%
  280. Would result in a path containing only C:\bin and probably cause the
  281. application to fail to start.
  282. Most people will want to use AppEnvironmentExtra exclusively. srvany only
  283. supports AppEnvironment.
  284. Managing services using the GUI
  285. -------------------------------
  286. NSSM can edit the settings of existing services with the same GUI that is
  287. used to install them. Run
  288. nssm edit <servicename>
  289. to bring up the GUI.
  290. NSSM offers limited editing capabilities for services other than those which
  291. run NSSM itself. When NSSM is asked to edit a service which does not have
  292. the App* registry settings described above, the GUI will allow editing only
  293. system settings such as the service display name and description.
  294. Managing services using the command line
  295. ----------------------------------------
  296. NSSM can retrieve or set individual service parameters from the command line.
  297. In general the syntax is as follows, though see below for exceptions.
  298. nssm get <servicename> <parameter>
  299. nssm set <servicename> <parameter> <value>
  300. Parameters can also be reset to their default values.
  301. nssm reset <servicename> <parameter>
  302. The parameter names recognised by NSSM are the same as the registry entry
  303. names described above, eg AppDirectory.
  304. NSSM offers limited editing capabilities for Services other than those which
  305. run NSSM itself. The parameters recognised are as follows:
  306. Description: Service description.
  307. DisplayName: Service display name.
  308. ImagePath: Path to the service executable.
  309. ObjectName: User account which runs the service.
  310. Name: Service key name.
  311. Start: Service startup type.
  312. Type: Service type.
  313. These correspond to the registry values under the service's key
  314. HKLM\SYSTEM\CurrentControlSet\Services\<service>.
  315. Note that NSSM will concatenate all arguments passed on the command line
  316. with spaces to form the value to set. Thus the following two invocations
  317. would have the same effect.
  318. nssm set <servicename> Description "NSSM managed service"
  319. nssm set <servicename> Description NSSM managed service
  320. Non-standard parameters
  321. -----------------------
  322. The AppEnvironment and AppEnvironmentExtra parameters recognise an
  323. additional argument when querying the environment. The following syntax
  324. will print all extra environment variables configured for a service
  325. nssm get <servicename> AppEnvironmentExtra
  326. whereas the syntax below will print only the value of the CLASSPATH
  327. variable if it is configured in the environment block, or the empty string
  328. if it is not configured.
  329. nssm get <servicename> AppEnvironmentExtra CLASSPATH
  330. When setting an environment block, each variable should be specified as a
  331. KEY=VALUE pair in separate command line arguments. For example:
  332. nssm set <servicename> AppEnvironment CLASSPATH=C:\Classes TEMP=C:\Temp
  333. The AppExit parameter requires an additional argument specifying the exit
  334. code to get or set. The default action can be specified with the string
  335. Default.
  336. For example, to get the default exit action for a service you should run
  337. nssm get <servicename> AppExit Default
  338. To get the exit action when the application exits with exit code 2, run
  339. nssm get <servicename> AppExit 2
  340. Note that if no explicit action is configured for a specified exit code,
  341. NSSM will print the default exit action.
  342. To set configure the service to stop when the application exits with an
  343. exit code of 2, run
  344. nssm set <servicename> AppExit 2 Exit
  345. The AppPriority parameter is used to set the priority class of the
  346. managed application. Valid priorities are as follows:
  353. The DependOnGroup and DependOnService parameters are used to query or set
  354. the dependencies for the service. When setting dependencies, each service
  355. or service group (preceded with the + symbol) should be specified in
  356. separate command line arguments. For example:
  357. nssm set <servicename> DependOnService RpcSs LanmanWorkstation
  358. The Name parameter can only be queried, not set. It returns the service's
  359. registry key name. This may be useful to know if you take advantage of
  360. the fact that you can substitute the service's display name anywhere where
  361. the syntax calls for <servicename>.
  362. The ObjectName parameter requires an additional argument only when setting
  363. a username. The additional argument is the password of the user.
  364. To retrieve the username, run
  365. nssm get <servicename> ObjectName
  366. To set the username and password, run
  367. nssm set <servicename> ObjectName <username> <password>
  368. Note that the rules of argument concatenation still apply. The following
  369. invocation is valid and will have the expected effect.
  370. nssm set <servicename> ObjectName <username> correct horse battery staple
  371. The following well-known usernames do not need a password. The password
  372. parameter can be omitted when using them:
  373. "LocalSystem" aka "System" aka "NT Authority\System"
  374. "LocalService" aka "Local Service" aka "NT Authority\Local Service"
  375. "NetworkService" aka "Network Service" aka "NT Authority\Network Service"
  376. The Start parameter is used to query or set the startup type of the service.
  377. Valid service startup types are as follows:
  378. SERVICE_AUTO_START: Automatic startup at boot.
  379. SERVICE_DELAYED_START: Delayed startup at boot.
  380. SERVICE_DEMAND_START: Manual service startup.
  381. SERVICE_DISABLED: The service is disabled.
  382. Note that SERVICE_DELAYED_START is not supported on versions of Windows prior
  383. to Vista. NSSM will set the service to automatic startup if delayed start is
  384. unavailable.
  385. The Type parameter is used to query or set the service type. NSSM recognises
  386. all currently documented service types but will only allow setting one of two
  387. types:
  388. SERVICE_WIN32_OWN_PROCESS: A standalone service. This is the default.
  389. SERVICE_INTERACTIVE_PROCESS: A service which can interact with the desktop.
  390. Note that a service may only be configured as interactive if it runs under
  391. the LocalSystem account. The safe way to configure an interactive service
  392. is in two stages as follows.
  393. nssm reset <servicename> ObjectName
  394. nssm set <servicename> Type SERVICE_INTERACTIVE_PROCESS
  395. Controlling services using the command line
  396. -------------------------------------------
  397. NSSM offers rudimentary service control features.
  398. nssm start <servicename>
  399. nssm restart <servicename>
  400. nssm stop <servicename>
  401. nssm status <servicename>
  402. Removing services using the GUI
  403. -------------------------------
  404. NSSM can also remove services. Run
  405. nssm remove <servicename>
  406. to remove a service. You will prompted for confirmation before the service
  407. is removed. Try not to remove essential system services...
  408. Removing service using the command line
  409. ---------------------------------------
  410. To remove a service without confirmation from the GUI, run
  411. nssm remove <servicename> confirm
  412. Try not to remove essential system services...
  413. Logging
  414. -------
  415. NSSM logs to the Windows event log. It registers itself as an event log source
  416. and uses unique event IDs for each type of message it logs. New versions may
  417. add event types but existing event IDs will never be changed.
  418. Because of the way NSSM registers itself you should be aware that you may not
  419. be able to replace the NSSM binary if you have the event viewer open and that
  420. running multiple instances of NSSM from different locations may be confusing if
  421. they are not all the same version.
  422. Example usage
  423. -------------
  424. To install an Unreal Tournament server:
  425. nssm install UT2004 c:\games\ut2004\system\ucc.exe server
  426. To run the server as the "games" user:
  427. nssm set UT2004 ObjectName games password
  428. To configure the server to log to a file:
  429. nssm set UT2004 AppStdout c:\games\ut2004\service.log
  430. To restrict the server to a single CPU:
  431. nssm set UT2004 AppAffinity 0
  432. To remove the server:
  433. nssm remove UT2004 confirm
  434. To find out the service name of a service with a display name:
  435. nssm get "Background Intelligent Transfer Service" Name
  436. Building NSSM from source
  437. -------------------------
  438. NSSM is known to compile with Visual Studio 2008 and later. Older Visual
  439. Studio releases may or may not work if you install an appropriate SDK and
  440. edit the nssm.vcproj and nssm.sln files to set a lower version number.
  441. They are known not to work with default settings.
  442. NSSM will also compile with Visual Studio 2010 but the resulting executable
  443. will not run on versions of Windows older than XP SP2. If you require
  444. compatiblity with older Windows releases you should change the Platform
  445. Toolset to v90 in the General section of the project's Configuration
  446. Properties.
  447. Credits
  448. -------
  449. Thanks to Bernard Loh for finding a bug with service recovery.
  450. Thanks to Benjamin Mayrargue ( for adding 64-bit support.
  451. Thanks to Joel Reingold for spotting a command line truncation bug.
  452. Thanks to Arve Knudsen for spotting that child processes of the monitored
  453. application could be left running on service shutdown, and that a missing
  454. registry value for AppDirectory confused NSSM.
  455. Thanks to Peter Wagemans and Laszlo Keresztfalvi for suggesting throttling
  456. restarts.
  457. Thanks to Eugene Lifshitz for finding an edge case in CreateProcess() and for
  458. advising how to build correctly in paths containing spaces.
  459. Thanks to Rob Sharp for pointing out that NSSM did not respect the
  460. AppEnvironment registry value used by srvany.
  461. Thanks to Szymon Nowak for help with Windows 2000 compatibility.
  462. Thanks to François-Régis Tardy for French translation.
  463. Thanks to Emilio Frini for spotting that French was inadvertently set as
  464. the default language when the user's display language was not translated.
  465. Thanks to Riccardo Gusmeroli and Marco Certelli for Italian translation.
  466. Thanks to Eric Cheldelin for the inspiration to generate a Control-C event
  467. on shutdown.
  468. Thanks to Brian Baxter for suggesting how to escape quotes from the command
  469. prompt.
  470. Thanks to Russ Holmann for suggesting that the shutdown timeout be configurable.
  471. Thanks to Paul Spause for spotting a bug with default registry entries.
  472. Thanks to BUGHUNTER for spotting more GUI bugs.
  473. Thanks to Doug Watson for suggesting file rotation.
  474. Thanks to Арслан Сайдуганов for suggesting setting process priority.
  475. Thanks to Robert Middleton for suggestion and draft implementation of process
  476. affinity support.
  477. Thanks to Andrew RedzMax for suggesting an unconditional restart delay.
  478. Thanks to Bryan Senseman for noticing that applications with redirected stdout
  479. and/or stderr which attempt to read from stdin would fail.
  480. Thanks to Czenda Czendov for help with Visual Studio 2013 and Server 2012R2.
  481. Thanks to Alessandro Gherardi for reporting and draft fix of the bug whereby
  482. the second restart of the application would have a corrupted environment.
  483. Licence
  484. -------
  485. NSSM is public domain. You may unconditionally use it and/or its source code
  486. for any purpose you wish.