node.js forever arguments for background - node.js

I am trying to run my node.js app using forever on windows 64 bit.
I have tried the followed, i installed foreman from npm . App is started with foreman start app.js. I observe that the node is running with my account.
When logged out of the box the process stops. Is there away to start foreman and node to run with a system account so that its always running with out associating node to a specific user.
Any help would be greatly appreciated. TIA

You would need to run your app or forman either as a service or a scheduled task triggered to run at startup.
I found this package that will replace forever and install pm2 as a service.
https://www.npmjs.com/package/pm2-windows-service
Using forever:
There is at least this Stackoverflow question covering creating a service and probably others.
Question about creating a service from an exe
Creating a scheduled task tutorial
Open Task scheduler:
Use windows search or control panel/administrative tools/Task Scheduler
You can also open a cmd console and copy %windir%\system32\taskschd.msc /s into it and hit enter.
From there you can create a new task, set a schedule that triggers on startup, point it to forever and set it to run if your logged in or not.
The link above, or other google results, will give you good tutorial info to work through it step by step.

Related

Manage terminal with node Powershell : start, interact and stop them

I'm developping an desktop app with electron, where I need to run dynamically many server in the backend :
My solution is to use node-powershell, to run powershell command in the backend application.
I need to start and stop dynamically terminal and interact with them, push command inner them then get the output in my xterm.js interface.
I found how start and stop it, with Start-Process but I still have no ideas how intrect with thoses, once there are running

Post-build actions in Python/Linux webapp do not run

I have a Django-based web app deployed from Github, running in Python 3.9. The app deploys and starts successfully.
I need to add post-build actions to complete the deployment; the exceeding common Django task of running "manage.py". Following the general and python-specific docs I have added the an app setting of
POST_BUILD_SCRIPT_PATH=postbuild.sh
There is a shell script, postbuild.sh in the root of my app, which runs fine if I SSH into the running container. The expected behaviour is that after deployment, this should run, and output to the deployment log. Neither of these things happen.
I have tested the app setting POST_BUILD_COMMAND with a very simple echo, and that does nothing either.
Can you tell me either what I need to do to make these app settings work, or suggest an alternative method of running the post-build script?
Please note that this is a Linux app using Oryx, so answers concerning Windows/Kudu like this one aren't related.
I noticed you asked your question over here as well. Your setting needs to be set to a relative path, /postbuild.sh.

Azure Batch Pool Stuck on Start Up Task

Hi everyone currently I am working on automating installation of certain application in one of our pool node in Azure Batch using application package.
For this example I am just trying to install google chrome in one our node but the node keeps getting stuck in waiting the startup task. The start up task is very simple as
cmd /c %AZ_BATCH_APP_PACKAGE_CHROME#95%\\ChromeSetup.exe -args -here
Please make certain that your installer is able to install in a non-interactive mode. For Google Chrome, this may help.
It turns out the it requires you to elevate the user access level to admin. It was not highlighted in documentation when using application package in batch account.
Just add this in your json config when deploying batch account node.

Pass Node.js commands while running the file

I'm building a small application that will be running 24/7. I need to be able to give the app Node.js's commands from the console.
Currently, if i want to give an additional command to the app i have to edit it's files, kill it then start it again. I want to start it once and be able to run commands from the console.

How to make Team City release the exe once node starts

I am trying to get a node.js application working on a CI server (Team City). I have a build step which goes like this...
npm start "path/to/my/app"
And it works however the build step hangs because the console will not shut down (it can't because it needs to stay open to run the server). So what can I do to get Team City to kick off the command line without staying open?
You are facing a more general problem of running node.js as a background service (the one that does not hold the console etc.)
Common solution to this is to use Forever CLI tool

Resources