Giter Club home page Giter Club logo

pm2-hive.github.io's People

Contributors

102 avatar adriagalin avatar adrivanhoudt avatar ashwinsoni avatar benoitzugmeyer avatar davidjb avatar flipace avatar fresheneesz avatar jorge-d avatar mattriddell avatar nick-w-nick avatar niftylettuce avatar pcj avatar peternewman avatar raine avatar redexp avatar richayotte avatar rmonnier9 avatar rochmoreau avatar rpallas avatar samuliasmala avatar sankar4n avatar sarmadsangi avatar schlueter avatar shubs avatar soyuka avatar twokwy avatar unitech avatar vmarchaud avatar wallet77 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  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

pm2-hive.github.io's Issues

Need an example for restart...

Hi, I've tried using the pm2 api to restart my app from within itself, but can't get it to work. This is what I have :

pm2.connect(function(err){
                    pm2.list(function(err,proc){
                        var procs = new Array();
                        for(var i=0; i < proc.length; i++){
                            if(proc[i].name !== 'LabMan_ADMIN'){
                                procs.push(proc[i]);
                                //pm2.restart(proc[i]);  
                            }           
                        } 
                        pm2.disconnect();
                        pm2.restart(procs[0],function(err, proc){
                            console.error("Error restarting proc");
                            console.error(err);
                            console.error(proc);
                        });
                    });
                });

Clearly I've got something wrong (yes I know that procs[0] is only going to restart 1... Or it would... It was part of my testing.

I tried using the name, the id... nothing seems to work.

Thank you for any help you have!

Execute Script after Restart

Hello,
is there a way when I restart my process via the web interface that it then runs a script on the server?

pm2 start with --log option

The docs say that --log (or -l) on the pm2 cli will put both error and out logs in to that file specified after the -l flag. This is true, except it continues to write a second logging file in the default location /home/xxx/.pm2/logs.

This does not happen if you specify -e and -o separately.

Documentation: Correct way to deploy on maximum cores?

Documentation is conflicting:

http://pm2.keymetrics.io/docs/usage/cluster-mode/ states:

The -i or instances option can be:

0/max to spread the app across all CPUs
-1 to spread the app across all CPUs - 1
number to spread the app across number CPUs

http://pm2.keymetrics.io/docs/usage/quick-start/#cheatsheet states

Cluster mode

pm2 start app.js -i 0 # Will start maximum processes with LB depending on available CPUs
pm2 start app.js -i max # Same as above, but deprecated.

How can i install ts-node interpreter

Interpreter --/node_modules/pm2/node_modules/.bin/ts-node is NOT AVAILABLE in PATH. (type 'which ----/node_modules/pm2/node_modules/.bin/ts-node' to double check.)

Add example for cluster mode in heroku integration

Currently the heroku integration docs does not show how to setup cluster mode for heroku.

How is cluster mode for heroku different?

If we specify instances: "max" in our ecosystem.config.js file, 8 different instances of process would be deployed. But these 8 CPUs as detected by PM2 are shared and the deployment will fail. The better option is to use instances: process.env.WEB_CONCURRENCY || "max".

Hide not yet implemented feature from the document

Hi,
According to this issue, stop-exit-codes option is not yet merged to the main version. So it should not appear in the documentation.
Please consider hide it until this function is merged to the main branch, or add a tip to notice user to install #development version to use this feature.

Thanks

logging to a tmpfs and pm2 save

The combination doesn't work. If you specify -o and -e to save to "/tmp" for example (as in the case of a RO raspberry pi) while the logging works, if you pm2 save and reboot, the process won't restart indicating:

Current process list running is not in sync with saved list ... App xxx differs. Type 'pm2 save' to synchronize.

How do folks pm2 log to a tmpfs?

Wrong shell command for FreeBSD getting error: Bad : modifier in $ '/'.

When running

env PATH=$PATH:/usr/local/bin pm2 startup rcd -u webhost --hp /home/webhost

I get

Bad : modifier in $ '/'.

I guess that's due to root shell in FreeBSD is tcsh. So instead of "env" it should be "setenv".

I still don't know what exactly should be achieved by that line since /usr/local/bin is in the system path by default in FreeBSD.

Maybe someone can clarify on this.

Watch can be a boolean, an array of paths or a string representing a path. Can it?

https://github.com/pm2-hive/pm2-hive.github.io/blame/master/docs/features/watch-restart.md#L39
says:

As specified in the Schema:
watch can be a boolean, an array of paths or a string representing a path

but in Schema
https://github.com/pm2-hive/pm2-hive.github.io/blame/master/docs/features/app-declaration.md#L179
it says:

Field Type Example Description
watch boolean or [] true enable watch & restart feature, if a file change in the folder or subfolder, your app will get reloaded

Document how to make autostart work for pm2 by root and its jobs by non-root users

I start pm2 as a root, but I start jobs run under another user.
I can't make pm2 autostart to respect this choice under CentOS 7.

Please, provide a step-by-step guide on how to make pm2 be autostarted by root and its job be autostarted by another user.

The problem is that pm2 never saves dumps to user's home dir, but pm2 autostart results into a .service pointing to the user's home dir and thus of course it fails to find the absent files upon startup.

Dir change error

Hey,
I'm using pm2 since some months now and its great for hosting scripts.

I tried to upload a script which uses fs and I got errors that it cant open the path.
I started it with node direct and it worked.
It's my first Raspberry pi (4b, 4GB) with Linux OS (Raspberry pi OS Lite 32-bit) so

Update:
Found out its the dictionary which causes my issue
Node/JavaScript don't find the library because you have to cd in the library and start the script then
Found out because node /home/pi/FTP.../index.js didn't work but cd /home/pi/FTP... and node index.js did

Is there some way to fix this?

Use HTTPS-only for serving pm2 site and docs

At present, HTTPS serving is available and working for the pm2 docs at https://pm2.keymetrics.io/ but the site is served over insecure HTTP by default (http://pm2.keymetrics.io/)

As Firefox/Chrome etc continue to mark more uses of HTTP as insecure (Chrome, Firefox), it would be great if the docs could switch to being HTTPS-only -- eg doing a 301 redirect to HTTPS by default + sending HSTS headers etc.

Since HTTPS is already up and working for you with Let's Encrypt, the change wouldn't be a major one.

Logfiles are Locked?

I want to show the Logfiles on my Website; But over PHP i can't access/find the files but the path is definitively correct.

Anyone have a suggestion?

how can i pass env ?

i need to run process like : --env production
how can i do this with pm2 Api ( pm2.start(opt ,err))

.deb Package repo cannot be resolved

$ sudo apt update
Err:1 http://apt.pm2.io/ubuntu stable InRelease
  Could not resolve 'apt.pm2.io'
Hit:2 https://dl.yarnpkg.com/debian stable InRelease
Hit:3 http://mirrors.digitalocean.com/ubuntu focal InRelease
Hit:4 http://mirrors.digitalocean.com/ubuntu focal-updates InRelease
Hit:5 https://repos.insights.digitalocean.com/apt/do-agent main InRelease
Hit:6 https://repos-droplet.digitalocean.com/apt/droplet-agent main InRelease
Hit:7 https://deb.nodesource.com/node_14.x focal InRelease
Hit:8 http://mirrors.digitalocean.com/ubuntu focal-backports InRelease
Hit:9 http://security.ubuntu.com/ubuntu focal-security InRelease
Reading package lists... Done
Building dependency tree
Reading state information... Done
All packages are up to date.
W: Failed to fetch http://apt.pm2.io/ubuntu/dists/stable/InRelease  Could not resolve 'apt.pm2.io'
W: Some index files failed to download. They have been ignored, or old ones used instead.

Environment:

NAME="Ubuntu"
VERSION="20.04.3 LTS (Focal Fossa)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 20.04.3 LTS"
VERSION_ID="20.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=focal
UBUNTU_CODENAME=focal

Adverts at the bottom of the docs

Just a heads up that it looks like Disqus has enabled some adverts on your comment form at the bottom of each docs page. E.g.

image

They've done this without warning before on one of my sites.

Edit: Thought I'd add, just in case: If you purposely enabled them, this is absolutely not a complaint - the PM2 project deserves as much funding as it can get as far as I'm concerned. But if that is the case, Disqus' RPM/CPM is significantly lower than what you'd get from a dev-focused ad network. Though, I'd have guessed that your enterprise revenue would dwarf any possible docs ads revenue.

error: unknown option `--update_env' on restart

Im using v-4.5.1

wen i do ( like docs says) :

me@server:~# PORT=3010 pm2 restart my.domain/api --update_env

error: unknown option `--update_env'

me@server:~#

where my.domain/api is the name of an app runing and managed for pm2.

What's happening folks ?

CheatSheet in quick-start seems to indicate that "max" argument for cluster mode is deprecated?

In the CheatSheet at the end of the quick start page the section on clustering show:

# Cluster mode
pm2 start app.js -i 0        # Will start maximum processes with LB depending on available CPUs
pm2 start app.js -i max      # Same as above, but deprecated.

This says that the max argument is deprecated, yet the example in the cluster mode section shows using the max argument. Also the cluster mode page shows using max and makes no mention of this argument being deprecated.

So is max really deprecated or is that comment a mistake?

Capture 'While restarting/reloading a process' is removed from the doc?

I found a link –update-env that links to the address :

http://pm2.keymetrics.io/docs/usage/environment/#while-restarting-reloading-a-process

But i found that this capture is removed from the doc in commit ddd9e18 without commit comment.
Is the feature --update-env has been removed? or the doc is edited by mistake?

If --update-env is removed, could i create a PR that removed the dead link from this page? If this capture is removed by mistake, could we revert this commit?

native logrotate issues

sudo pm2 logrotate -u user from an account that is not named "user" doesn't do what's expected. For example, if my account name is "pi" and I execute this command, it does the following in lograte.d/:

/home/pi/.pm2/pm2.log /home/pi/.pm2/logs/*.log {
        rotate 12
        weekly
        missingok
        notifempty
        compress
        delaycompress
        create 0640 user user
}

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.