Unitech / Unitech/pm2

--wait-ip not working until I append --wait-ip into the output command

Open
#5,449 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
43.3k
Forks
2.7k
PR merge metrics
No merged PRs in 30d

Description

pm2 startup systemd --wait-ip

[PM2] Init System found: systemd
[PM2] To setup the Startup Script, copy/paste the following command:
sudo env PATH=$PATH:/home/vods/.nvm/versions/node/v14.20.0/bin /home/vods/.nvm/versions/node/v14.20.0/lib/node_modules/pm2/bin/pm2 startup systemd -u vods --hp /home/vods

[PM2] Init System found: systemd
Platform systemd
Template
[Unit]
Description=PM2 process manager
Documentation=https://pm2.keymetrics.io/
After=network.target

[Service]
Type=forking
User=vods
LimitNOFILE=infinity
LimitNPROC=infinity
LimitCORE=infinity
Environment=PATH=/home/vods/.nvm/versions/node/v14.20.0/bin:/home/vods/.local/bin:/home/vods/bin:/root/.nvm/versions/node/v14.19.2/bin:/usr/local/jdk-11.0.15.1/bin:/usr/local/jdk-11.0.15.1/jre/bin:/usr/local/sbin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin:/usr/local/pgsql/bin/:/usr/local/apache-maven-3.8.2/bin:/usr/local/go/bin:/usr/local/ffmpeg-4.4-amd64-static/:/root/srt-1.4.3:/usr/local/minio:/root/bin:/home/vods/.nvm/versions/node/v14.20.0/bin:/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin
Environment=PM2_HOME=/home/vods/.pm2
PIDFile=/home/vods/.pm2/pm2.pid
Restart=on-failure

ExecStart=/home/vods/.nvm/versions/node/v14.20.0/lib/node_modules/pm2/bin/pm2 resurrect
ExecReload=/home/vods/.nvm/versions/node/v14.20.0/lib/node_modules/pm2/bin/pm2 reload all
ExecStop=/home/vods/.nvm/versions/node/v14.20.0/lib/node_modules/pm2/bin/pm2 kill

[Install]
WantedBy=multi-user.target

If I modify the command , append --wait-ip to the command, then it works

sudo env PATH=$PATH:/home/vods/.nvm/versions/node/v14.20.0/bin /home/vods/.nvm/versions/node/v14.20.0/lib/node_modules/pm2/bin/pm2 startup systemd --wait-ip -u vods --hp /home/vods

[PM2] Init System found: systemd
Platform systemd
Template
[Unit]
Description=PM2 process manager
Documentation=https://pm2.keymetrics.io/
After=network-online.target
Restart=on-failure

[Service]
Type=forking
User=vods
LimitNOFILE=infinity
LimitNPROC=infinity
LimitCORE=infinity
Environment=PATH=/home/vods/.nvm/versions/node/v14.20.0/bin:/home/vods/.local/bin:/home/vods/bin:/root/.nvm/versions/node/v14.19.2/bin:/usr/local/jdk-11.0.15.1/bin:/usr/local/jdk-11.0.15.1/jre/bin:/usr/local/sbin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin:/usr/local/pgsql/bin/:/usr/local/apache-maven-3.8.2/bin:/usr/local/go/bin:/usr/local/ffmpeg-4.4-amd64-static/:/root/srt-1.4.3:/usr/local/minio:/root/bin:/home/vods/.nvm/versions/node/v14.20.0/bin:/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin
Environment=PM2_HOME=/home/vods/.pm2
PIDFile=/home/vods/.pm2/pm2.pid

ExecStart=/home/vods/.nvm/versions/node/v14.20.0/lib/node_modules/pm2/bin/pm2 resurrect
ExecReload=/home/vods/.nvm/versions/node/v14.20.0/lib/node_modules/pm2/bin/pm2 reload all
ExecStop=/home/vods/.nvm/versions/node/v14.20.0/lib/node_modules/pm2/bin/pm2 kill

[Install]
WantedBy=network-online.target

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the issue with pm2 startup systemd --wait-ip and compare its generated systemd unit with the output from placing --wait-ip after systemd. The payload names no source file or test; done means the documented command position produces the expected network-online systemd configuration without manual editing.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, node.js
Domain
cli, devops
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.