Iain Patterson [Tue, 25 Jan 2011 22:34:48 +0000 (22:34 +0000)]
Messages for kill_process_tree().
Iain Patterson [Tue, 25 Jan 2011 10:21:20 +0000 (10:21 +0000)]
Kill process tree when stopping service.
Ensure that all child processes of the monitored application are
killed when the service stops by recursing through all running
processes and terminating those whose parent is the application
or one of its descendents.
Iain Patterson [Fri, 19 Nov 2010 11:16:04 +0000 (11:16 +0000)]
NSSM 2.6.
Iain Patterson [Fri, 19 Nov 2010 07:31:35 +0000 (07:31 +0000)]
Removed incorrect ExpandEnvironmentStrings() error.
A log_event() call was inadvertently left in the code causing an error
to be set to the eventlog saying that ExpandEnvironmentStrings() had
failed when it had actually succeeded.
Iain Patterson [Sat, 25 Sep 2010 15:00:42 +0000 (16:00 +0100)]
NSSM 2.5.
Iain Patterson [Sat, 25 Sep 2010 14:52:07 +0000 (15:52 +0100)]
Expand environment strings in parameters.
Allow use of REG_EXPAND_SZ values in the registry.
Iain Patterson [Sat, 25 Sep 2010 13:37:28 +0000 (14:37 +0100)]
Don't suicide on exit status 0.
Suiciding when the application exits 0 will cause recovery actions to be
taken. Usually this is inappropriate. Only suicide if there is an
explicit AppExit value for 0 in the registry.
Technically such behaviour could be abused to do something like run a
script after successful completion of a service but in most cases a
suicide is undesirable when no actual failure occurred.
Iain Patterson [Sat, 25 Sep 2010 09:05:09 +0000 (10:05 +0100)]
Handle startup failure.
Don't hang if startup parameters couldn't be determined.
Instead, signal that the service entered the STOPPED state.
Set START_PENDING state prior to actual startup.
Iain Patterson [Thu, 23 Sep 2010 15:30:41 +0000 (16:30 +0100)]
NSSM 2.4.
Iain Patterson [Thu, 23 Sep 2010 14:27:14 +0000 (15:27 +0100)]
Ensure systems recovery actions can happen.
In Windows versions earlier than Vista the service manager would only
consider a service failed (and hence eligible for recovery action) if
the service exited without setting its state to SERVICE_STOPPED, even if
it signalled an error exit code.
In Vista and later the service manager can be configured to treat a
graceful shutdown with error code as a failure but this is not the
default behaviour.
Try to configure the service manager to use the new behaviour when
starting the service so users who set AppExit to Exit can use recovery
actions as expected.
Also recognise the new AppExit option Suicide for use on pre-Vista
systems. When AppExit is Suicide don't stop the service but exit
inelegantly, which should be seen as a failure.
Iain Patterson [Wed, 21 Apr 2010 21:56:33 +0000 (22:56 +0100)]
NSSM 2.3
Iain Patterson [Wed, 21 Apr 2010 21:53:55 +0000 (22:53 +0100)]
Fix path lengths.
Some buffers were being limited to MAX_PATH characters when higher
limits were more appropriate.
For example the maximum length of a command line is documented as 32768
characters with the application name part limited to MAX_PATH.
Long applications paths and arguments could be truncated when written to
the registry.
Thanks Joel Reingold.
Iain Patterson [Tue, 20 Apr 2010 21:56:55 +0000 (22:56 +0100)]
Log messages properly.
Format messages from resource. Use NSSM binary as the message source.
Note that replacing the binary is prevented if the event viewer is open.
Iain Patterson [Mon, 19 Apr 2010 22:17:55 +0000 (23:17 +0100)]
Compile messages.
Don't spam the event log with warnings about not finding application
messages.
Every message currently uses the default event ID 1.
Iain Patterson [Mon, 19 Apr 2010 20:57:27 +0000 (21:57 +0100)]
Don't break the window size.
The dialogue was being moved incorrectly, resulting in it inadvertently
changing size.
Iain Patterson [Sun, 4 Apr 2010 17:34:48 +0000 (18:34 +0100)]
NSSM 2.2.
Iain Patterson [Sun, 4 Apr 2010 16:46:17 +0000 (17:46 +0100)]
Decide how to handle application exit.
When the service exits with exit code n look in
HKLM\SYSTEM\CurrentControlSet\Services\<service>\Parameters\AppExit\<n>,
falling back to the unnamed value if no such code is listed. Parse the
(string) value of this entry as follows:
Restart: Start the application again (NSSM default).
Ignore: Do nothing (srvany default).
Exit: Stop the service.
Iain Patterson [Mon, 28 Dec 2009 11:51:00 +0000 (06:51 -0500)]
NSSM 2.1.
Iain Patterson [Sun, 10 Sep 2006 01:33:00 +0000 (21:33 -0400)]
NSSM 2.0.
Iain Patterson [Fri, 30 May 2003 18:32:00 +0000 (14:32 -0400)]
NSSM 1.0.
Iain Patterson [Fri, 30 May 2003 18:32:00 +0000 (14:32 -0400)]
Initial commit.