Startup Issue with CentOS8
Fresh Install of CentOS8 (8.2 to be more exact), node v12 (also tried v14 with the same results) and pm2
ran "pm2 startup" and after a restart, this keeps happening every 90 seconds (with or without an app started in pm2):
PM2 | pm2 has been killed by signal, dumping process list before exit... PM2 | Exited peacefully PM2 | pm2 has been killed by signal, dumping process list before exit... PM2 | Exited peacefully PM2 | pm2 has been killed by signal, dumping process list before exit... PM2 | Exited peacefully
Supporting information
I also removed 4.4.0 and installed 3.5.0, but the issue remains the same.
The only thing that helps is going to /etc/systemd/system/pm2-root.service and commenting the line: PIDFile=/root/.pm2/pm2.pid
Hope that helps
Report:
PM2 | 2020-07-09T15:55:11: PM2 log: SIGTERM timeout : 1600 PM2 | 2020-07-09T15:55:11: PM2 log: =============================================================================== PM2 | 2020-07-09T15:56:41: PM2 log: pm2 has been killed by signal, dumping process list before exit... PM2 | 2020-07-09T15:56:41: PM2 log: Exited peacefully PM2 | 2020-07-09T15:56:42: PM2 log: =============================================================================== PM2 | 2020-07-09T15:56:42: PM2 log: --- New PM2 Daemon started ---------------------------------------------------- PM2 | 2020-07-09T15:56:42: PM2 log: Time : Thu Jul 09 2020 15:56:42 GMT+0300 (Eastern European Summer Time) PM2 | 2020-07-09T15:56:42: PM2 log: PM2 version : 4.4.0 PM2 | 2020-07-09T15:56:42: PM2 log: Node.js version : 12.16.1 PM2 | 2020-07-09T15:56:42: PM2 log: Current arch : x64 PM2 | 2020-07-09T15:56:42: PM2 log: PM2 home : /root/.pm2 PM2 | 2020-07-09T15:56:42: PM2 log: PM2 PID file : /root/.pm2/pm2.pid PM2 | 2020-07-09T15:56:42: PM2 log: RPC socket file : /root/.pm2/rpc.sock PM2 | 2020-07-09T15:56:42: PM2 log: BUS socket file : /root/.pm2/pub.sock PM2 | 2020-07-09T15:56:42: PM2 log: Application log path : /root/.pm2/logs PM2 | 2020-07-09T15:56:42: PM2 log: Worker Interval : 30000 PM2 | 2020-07-09T15:56:42: PM2 log: Process dump file : /root/.pm2/dump.pm2 PM2 | 2020-07-09T15:56:42: PM2 log: Concurrent actions : 2 PM2 | 2020-07-09T15:56:42: PM2 log: SIGTERM timeout : 1600 PM2 | 2020-07-09T15:56:42: PM2 log: ===============================================================================
Nobody seems to be in a real hurry, but for whom it may concern, I've also posted on stackoverflow and added the things I discovered on my own there. I hope a fix will be added soon.
https://stackoverflow.com/questions/62814539/pm2-keeps-getting-killed-every-90-seconds-on-centos-8/
Same issue for me. It reset app every 90sec.
This solved my problem.
The only thing that helps is going to /etc/systemd/system/pm2-root.service and commenting the line: PIDFile=/root/.pm2/pm2.pid
Interestingly, I use centos 8 on two servers. I only encountered this problem in one.
You probably have selinux activated on only one of them. Did you read my stackoverflow post? It is listed above.
Related issue #4813
You probably have selinux activated on only one of them. Did you read my stackoverflow post? It is listed above.
@itoutcome It's not safe to disable SE Linux.
This method is the best at the moment:
Edit file: /etc/systemd/system/pm2-root.service
-
Add new line:
Environment=PM2_PID_FILE_PATH=/run/pm2.pid -
And replace:
PIDFile=/root/.pm2/pm2.pidto:PIDFile=/run/pm2.pid
Versions:
- CentOS 8.3.2011
- Node.js 14.16.0
- NPM 7.7.5
- PM2 4.5.5
Original answer. Thanks Alec!
Solution of @epexa was not working for me, unfortunately. I finally got it working with this one:
ausearch -c 'systemd' --raw | audit2allow -M my-systemd semodule -i my-systemd.pp
Which was described here...
Same issue for me. It reset app every 90sec.
This solved my problem.
The only thing that helps is going to /etc/systemd/system/pm2-root.service and commenting the line: PIDFile=/root/.pm2/pm2.pidInterestingly, I use centos 8 on two servers. I only encountered this problem in one.
This worked for me as well!