Git Product home page Git Product logo

nssm's People

Contributors

fgaranda avatar jpovedano avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

nssm's Issues

NSSM not working in github actions

I am tried to run a sample service in github actions with the run-on as windows-latest. When I tried to create a service I get this error:

Run .\hack\start-csi-proxy.ps1
using the .exe .\nssm-2.24\win64\nssm.exe
Service "csi-proxy" installed successfully!
csi-proxy: Unexpected status SERVICE_STOPPED in response to START control.

But when I try to run this script on my local windows machine it worked fine.

NSSM hang when AppKillProcessTree = 0 and child-process keep running

I'm using NSSM to launch my java application.

The problem is about a child-process who is launched from my application (another java JAR application to perform the update of my main application).

This child-process will perform a stop and a start over my NSSM service.

Here is the problem, when the child-process perform the STOP of the service, the service stay in state "stop pending" because the NSSM is wating for the child-process to stop too...

I have tried to set the nssm.exe set "my service name" AppKillProcessTree 0 but this configuration only tells to NSSM to prevent the kill of the process tree (children).

I tried to launch my child-process using the cmd.exe /c start java -jar ... expecting that NSSM will unknown this "child of a dead child process" but it also doesn't works and NSSM hangs too!

Rotate as soon as exactly one line is written

Hey guys,

first of all, thanks for this very nice tool! It's been a great help.

Now, to my issue. I start x services, and I would like to see and process each their stdout / stderr line in another process as soon as it happens. This is the setup I tried with nssm:

AppStdout = `${this.consolePath}/stdout.log`
AppStderr = `${this.consolePath}/stderr.log`
AppRotateFiles = "1"
AppRotateOnline = "1"
AppRotateBytes = "1"

I don't want to have another process wrapping the service as it is just an overkill, I want to watch for the files that are stdout-XXX.log and stderr-XXX.log, as I know those will not change.

So, the problems that happen with this approach:

  1. Readme states On-demand rotations will happen after the next line of data is read, but that's not exactly true. I have files that are not lines, but have more than one line or split in the middle. For example:

stdout-20200324T110716.619.log:

    VendorId                                : 4318
    DeviceId                                : 6918
    SubSysId          

stdout-20200324T110716.620.log:

                      : 342890970
    Revision                                : 161
    DedicatedVideoMemory                    : 11667505152
    DedicatedSystemMemory        
  1. In theory, I might have more than one line in stdout / stderr for a given millisecond, which makes rotate files naming bad.

  2. Again, readme states On-demand rotations will happen after the next line of data is read, which means that last line is held in original file (like stdout.log) until new line is written. This is dangerous for me to read, as the file can change etc, I should read it when it is in stdout-xxx.log form. Is there a way to enable that rotation happens as soon as a line is written, not on the next line?

Thanks again for this great tool, really appriciate it! I'm aware I have very specific needs, but I guess behavior I need would be a great plus to the already great tool. Thanks!

about version 2.25

i need to download nssm 2.25 because i need to execute commands in response to service events.
is the functionality "execute commands in response to service events" already developed?

Forward NSSM_ hook enviroment variables to the service command

I need to access information about the NSSM parameters from my application, and would be nice to have the same NSSM environment variables passed for hooks in the main application.

This is a nice feature, for example, to my application to known the NSSM_SERVICE_NAME, to my application to be able to perform a service restart of itself.

This variables (tooked from README.md):

NSSM_EXE - Path to NSSM itself.
  NSSM_CONFIGURATION - Build information for the NSSM executable,
    eg 64-bit debug.
  NSSM_VERSION - Version of the NSSM executable.
  NSSM_BUILD_DATE - Build date of NSSM.
  NSSM_PID - Process ID of the running NSSM executable.
  NSSM_DEADLINE - Deadline number of milliseconds after which NSSM will
    kill the hook if it is still running.
  NSSM_SERVICE_NAME - Name of the service controlled by NSSM.
  NSSM_SERVICE_DISPLAYNAME - Display name of the service.
  NSSM_COMMAND_LINE - Command line used to launch the application.
  NSSM_APPLICATION_PID - Process ID of the primary application process.
    May be blank if the process is not running.
  NSSM_EVENT - Event class triggering the hook.
  NSSM_ACTION - Event action triggering the hook.
  NSSM_TRIGGER - Service control triggering the hook.  May be blank if
    the hook was not triggered by a service control, eg Exit/Post.
  NSSM_LAST_CONTROL - Last service control handled by NSSM.
  NSSM_START_REQUESTED_COUNT - Number of times the application was
    requested to start.
  NSSM_START_COUNT - Number of times the application successfully started.
  NSSM_THROTTLE_COUNT - Number of times the application ran for less than
    the throttle period.  Reset to zero on successful start or when the
    service is explicitly unpaused.
  NSSM_EXIT_COUNT - Number of times the application exited.
  NSSM_EXITCODE - Exit code of the application.  May be blank if the
    application is still running or has not started yet.
  NSSM_RUNTIME - Number of milliseconds for which the NSSM executable has
    been running.
  NSSM_APPLICATION_RUNTIME - Number of milliseconds for which the
    application has been running since it was last started.  May be blank
    if the application has not been started yet.

Can we change the format of rotated file's name?

Based on document said, the format of rotated file name is myservice-20140114T180840.953.log. And it seems like there is no property to change the format.

What I want is like myservice.log.1, myservice.log.2 instead of default format.

Is it possible to achieve my goal?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.