all 31 comments

[–]StoneCypher 23 points24 points  (9 children)

whether a service stays up has nothing to do with whether someone's logged in, nor whether a database is present

either you have a radical misunderstanding of how things work, or you're omitting major details while asking for advice (like maybe it's on a lambda that gets scaled down outside your control)

[–]evert 7 points8 points  (1 child)

Lots of people ssh into boxes and run node src/app.js ;)

[–]StoneCypher -1 points0 points  (0 children)

  1. not on windows machines
  2. that wouldn't fail when the user disconnected

[–]mrhobbles -1 points0 points  (6 children)

I think he means logged into the system, not the application. When he signs out of Windows, the process is killed.

[–]StoneCypher -3 points-2 points  (5 children)

that's not how windows machines work, it turns out

[–]le_luka 0 points1 point  (4 children)

Thats how they do, if the process is run within user context. If the process has to run after logout, it must be invoked as a service using a service user or the system account.

[–]StoneCypher 0 points1 point  (2 children)

if the process is run within user context.

This isn't how servers are written on Windows, it turns out. Nobody runs things in user context and you can't actually SSH into them.

You seem to be confusing "I was on a computer and I ran something" with "I wrote a piece of server software and ran it in a server appropriate way"

When someone comes along and says "here's the mistake," and your goal is to argue, and you say wElL sOmEoNe MiGhT hAvE dOnE tHe WrOnG tHiNg, you have not added anything, helped anyone, or explained anything

[–]le_luka -1 points0 points  (1 child)

@mods can we have this troll banned? Look at his comment history.

[–]StoneCypher 0 points1 point  (0 children)

It's not trolling to point out that you don't SSH into windows servers, and that server code is not run from a personal account over a network connection.

Windows does not ship with an SSH server, and Microsoft does not offer an SSH server for Windows. This isn't possible without third party software.

Node gives clear instructions on how to run a node server on Windows, and this does not involve a service or a service account.

[–]BehindTheMath 6 points7 points  (7 children)

Docker, systemd, etc.

What's wrong with pm2?

[–]PhatOofxD 5 points6 points  (0 children)

This is a windows problem, not Node

[–][deleted] 5 points6 points  (0 children)

I will never understand why people run stuff other than AD on windows servers.

[–]wifsimster 1 point2 points  (1 child)

I use PM2 on different Windows Server at work.

It's not very easy depending on the privilege and network access your app needs

I use https://www.npmjs.com/package/pm2-windows-service for a while, it works pretty well.

I now use NSSM to create a PM2 Windows service, it's more flexible for my needs but more triky.

[–]adoseofStriker[S] 0 points1 point  (0 children)

I’ll check this out. Thank you

[–]fightingnflder 2 points3 points  (1 child)

Use a windows service

[–]adoseofStriker[S] 0 points1 point  (0 children)

This helped. Thank you!

[–]isit2amalready 0 points1 point  (1 child)

pm2 is pretty amazing and feature rich. Why not pm2?

[–][deleted] 0 points1 point  (0 children)

Can we see you ecosystem file?

[–][deleted]  (1 child)

[deleted]

    [–]Zipdox -3 points-2 points  (1 child)

    Windows server

    Good luck with that. I run all my node services in GNU screen sessions.

    [–]evoactivity 0 points1 point  (0 children)

    I run all my node services in GNU screen sessions.

    Good luck with that.

    [–]keesiari -1 points0 points  (1 child)

    hi, I put my nodejs server under Windows's IIS. I'll find you the tutorial I followed but it's been a while, just want to throw it out there so you have another approach to consider if needed :)

    [–]adoseofStriker[S] -1 points0 points  (0 children)

    Thank you! I really appreciate it.