pm2 proper path for ecosystem.config.js - pm2

I would like to instruct pm2 to always read the global ecosystem.config.js in:
C:\ProgramData\pm2\ecosystem.config.js or
C:\ProgramData\pm2\my-pm2-apps.config.js
by a simplified name/command - meaning: If I go to the terminal as Administrator, and to a random folder e.g: C:\temp\ (but NOT C:\ProgramData\pm2) and I type
pm2 start my-pm2-apps
pm2 stop my-pm2-apps
etc.
it will do the same as:
pm2 start C:\ProgramData\pm2\ecosystem.config.js
pm2 stop C:\ProgramData\pm2\ecosystem.config.js
or
pm2 start C:\ProgramData\pm2\my-pm2-apps.config.js
pm2 stop C:\ProgramData\pm2\my-pm2-apps.config.js
etc.
At this time I see it done by a separate PowerShell script that is added to the Windows PATH env.var., but is there a more direct way with pm2 itself?

Related

Relation of dump.pm2 and ecosystem.json

i'm using pm2-windows-service to start PM2 as service.
I don't understand the relationship between dump.pm2 and ecosystem.json. It looks like they are all the pm2 boot config that will be used. But which would take precedence if both in dump.pm2 and ecosystem.json were defined?
Please tell me the answer . Thanks you.
ecosystem.json will have a higher priority than dump.pm2.
When there is no ecosystem.json file it will use dump.pm2 file. dump.pm2 will be generated when running the command : pm2 save.
It is more convenient to use the ecosystem.json because we just need to change the settings in the ecosystem.json. If we use dump.pm2, we need to run the app again (pm2 start ...) and then update the dump file with the command : pm2 save

How can I disable timestamps on PM2?

I wanted to use see timestamps on my log output from pm2, so I stopped the process and started it again with:
pm2 start www --log-date-format "MM/DD HH:mm"
Which successfully gave me timestamps. I now want to turn them off, but restarting doesn't work.
You have to delete the process from PM2 with pm2 delete www and then add it back with pm2 start www.

How to change the parameters of a pm2 process?

I would like to change some parameters of a pm2 process, particularly the exec cwd path since I am getting an error in the log that it cannot open the file but there is no error when launching the script from its folder .
How can I do that?
EDIT
pm2 cannot start the process after I modified the related script to open a file in the same folder of the script. I see with pm2 describe my-process that the exec cwd is one-level-higher directory of the script directory so I am not assuming the file cannot be found for this reason.
It's possible that you must try to launch script with admin permission (using sudo)

How can I uninstall IPFS completely and restart everything from scratch and get a new peer id?

How can I uninstall IPFS completely and restart everything from scratch and get a new peer id? I tried to delete the go-ipfs folder but I can still get Error: ipfs configuration file already exists! when I do ipfs init.
The data store as well as the config will be stored in a subdirectory .ipfs of your home directory. So if you are on a UNIX based system $HOME/.ipfs. You would have to delete this directory and then run ipfs init to get an empty store and a new peer id.
Note that you can also configure the location of the store directory using the IPFS_PATH environment variable, which can be useful to get the IPFS store on a different mount point.

View the log in WildFly Cartridges in OpenShift

I'm starting to use OpenShift and I tried to deploy a application that are already use WildFly, I installed de WildFly Cartridges and configure de standalone.xml from the Source Code but when I restarted de application WildFly didn't start so I believe that is because a fail in the standalone.xml but I don't know how I can see the logs to really understand why fail to start the server.
Additionally I add a keystore in .openshift\config and configured it in the standalone.xml like this:
<server-identities>
<ssl>
<keystore path="localhost.keystore" relative-to="jboss.server.config.dir" keystore-password="XXXX" alias="XXXX" key-password="XXXX"/>
</ssl>
</server-identities>
I don’t know if the keystore is in the right place or I need to copy it in other place.
You should be able to use the rhc tail command, or ssh int your gear and look in your ~/app-root/logs directory.
The command rhc tail -a appname will tail all application log files in the OPENSHIFT_LOG_DIR directory for the primary web gear of the application.
rhc tail -a appname
To stop tailing the logs, press Ctrl + c.
Tailing Specific Files
The -f option can be appended to the tail command to specify a particular file to tail. The wild card (*) character can be used to specify multiple files. The path given should be relative to the OpenShift application user’s home directory on the gear.
The following example tails all files in the OpenShift log directory with a name starting with php.log, which includes files with a time stamp appended to their name.
rhc tail -f app-root/logs/php.log* -a myapp
for Custom Tail and other Options
see https://developers.openshift.com/en/managing-log-files.html