Pm2: PM2 startup script generation fails on CentOS 6.x

Created on 16 Dec 2016  路  3Comments  路  Source: Unitech/pm2

If reporting a bug, please use the following template.

Expected behaviour

Running the following command should produce a startup script:
sudo su -c "env PATH=$PATH:/usr/bin pm2 startup centos ecosystem.json -u nodeadmin --hp /home/nodeadmin"

Actual behaviour

The command fails as follows:

[PM2] Writing init configuration in /etc/systemd/system/pm2.service
[PM2][ERROR] Failure when trying to write startup script

ENOENT: no such file or directory, open '/etc/systemd/system/pm2.service'

Steps to reproduce

Run the command below on CentOS 6.x
sudo su -c "env PATH=$PATH:/usr/bin pm2 startup centos ecosystem.json -u nodeadmin --hp /home/nodeadmin"

Software versions used

OS         : CentOS 6 (I'm not sure of the minor release (6.8 I think) but can get it if necessary)
node.js    : 6.9.2
PM2        : @latest (2.2.1)

PM2 Log output

Use the command: tail --lines 50 ~/.pm2/pm2.log

(Unavailable at the moment)
...
```

cf CONTRIBUTING.md for more informations

Most helpful comment

Just run pm2 startup if you dont know which platform to use.

All 3 comments

Centos 6 use SystemV, it should work using pm2 startup systemv.

To clarify, the documentation pointed to by the Release 2.2.1 notes says

SystemD: Ubuntu >= 16, CentOS, Arch, Debian >= 7

Could you verify that we should 'systemv' please? In the doc below 'systemd' is listed twice. Is one of those supposed to be 'systemv'?

I don't have access to the server and have to instruct others, so I can't test for myself.

Also, we have RedHat servers as well. Is 'redhat' still supported? Should I worry? :-)

Thanks for a great product.

Just run pm2 startup if you dont know which platform to use.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jubairsaidi picture jubairsaidi  路  3Comments

rangercyh picture rangercyh  路  4Comments

FujiHaruka picture FujiHaruka  路  3Comments

mario-mui picture mario-mui  路  3Comments

shaunwarman picture shaunwarman  路  3Comments