What the hell is NSSM ??
Updated: Apr 21
I have been working on AIX & linux servers from quite a long time. There comes a time when we need to keep our shell script job running in background even if our session terminates or user get logged out.
In that case, nohup command comes to rescue. Just start your command with “nohup” and ends it with “&”.
But wait, what about Windows server ??
Easy way is to use built in windows cmd “sc create”
sc create “ServiceName” start= demand displayname= “DisplayName” binpath= [path to .bat file]
But what if my service get failed ?
That's where, NSSM comes to the picture. NSSM stands for Non-Sucking Service Manager. As the name suggests, it will never suck even if our job fails. NSSM monitors the running service and will restart if it dies.
Follow below commands & boom....your service is up and running in background.
nssm install "ServiceName" nssm start "ServiceName"
NSSM also logs all progress in an Event Log, making it easier to identify applications that aren’t behaving as they should.
For more info, just visit the official website.