You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[Unit]
Description=PM2 next gen process manager for Node.js
After=network.target remote-fs.target
[Service]
Type=forking
PIDFile=/var/app/myapp/.pm2/pm2.pid
User=myapp
ExecStartPre=/usr/lib/node_modules/pm2/bin/pm2 kill
ExecStart=/usr/lib/node_modules/pm2/bin/pm2 resurrect
ExecReload=/usr/lib/node_modules/pm2/bin/pm2 reload all
ExecStop=/usr/lib/node_modules/pm2/bin/pm2 dump
ExecStop=/usr/lib/node_modules/pm2/bin/pm2 delete all
ExecStop=/usr/lib/node_modules/pm2/bin/pm2 kill
[Install]
WantedBy=multi-user.target
Systemd should recognize this service as being online.
Actual behaviour
$ sudo systemctl status pm2-myapp.service
.snip.
Active: inactive (dead) since Mon 2016-08-22 19:14:45 UTC; 4min 46s ago
.snip.
Steps to reproduce
pm2 startup systemd
Software versions used
OS : Ubuntu 16.04
node.js : 5.12.0, 6.3.1
PM2 : 1.1.3, next
PM2 Log output
Use the command: tail --lines 50 ~/.pm2/pm2.log
2016-08-22 19:28:10: Starting execution sequence in -cluster mode- for app name:myapp id:0
2016-08-22 19:28:10: App name:myapp id:0 online
2016-08-22 19:28:10: Starting execution sequence in -cluster mode- for app name:myapp id:1
2016-08-22 19:28:11: App name:myapp id:1 online
2016-08-22 19:28:11: Starting execution sequence in -fork mode- for app name:myapp-auth id:2
2016-08-22 19:28:11: App name:myapp-auth id:2 online
2016-08-22 19:28:11: Starting execution sequence in -fork mode- for app name:myapp-worker id:3
2016-08-22 19:28:11: App name:myapp-worker id:3 online
2016-08-22 19:28:11: Starting execution sequence in -fork mode- for app name:myapp-worker2 id:4
2016-08-22 19:28:11: App name:myapp-worker2 id:4 online
2016-08-22 19:28:22: Stopping app:myapp id:0
2016-08-22 19:28:23: Process with pid 6936 still not killed, retrying...
2016-08-22 19:28:23: Process with pid 6936 still not killed, retrying...
2016-08-22 19:28:23: Process with pid 6936 still not killed, retrying...
2016-08-22 19:28:23: Process with pid 6936 still not killed, retrying...
2016-08-22 19:28:24: Process with pid 6936 still not killed, retrying...
2016-08-22 19:28:24: Process with pid 6936 still not killed, retrying...
2016-08-22 19:28:24: Process with pid 6936 still not killed, retrying...
2016-08-22 19:28:24: Process with pid 6936 still not killed, retrying...
2016-08-22 19:28:24: Process with pid 6936 still not killed, retrying...
2016-08-22 19:28:24: Process with pid 6936 still not killed, retrying...
2016-08-22 19:28:24: Process with pid 6936 still not killed, retrying...
2016-08-22 19:28:24: Process with pid 6936 still not killed, retrying...
2016-08-22 19:28:24: Process with pid 6936 still not killed, retrying...
2016-08-22 19:28:25: Process with pid 6936 still not killed, retrying...
2016-08-22 19:28:25: Process with pid 6936 still alive after 1600ms, sending it SIGKILL now...
2016-08-22 19:28:25: App name:myapp id:0 disconnected
2016-08-22 19:28:25: App [myapp] with id [0] and pid [6936], exited with code [0] via signal [SIGKILL]
2016-08-22 19:28:25: [HandleExit] PM2 is being killed, stopping restart procedure...
2016-08-22 19:28:25: Stopping app:myapp id:1
2016-08-22 19:28:26: Process with pid 6945 still not killed, retrying...
2016-08-22 19:28:26: Process with pid 6945 still not killed, retrying...
2016-08-22 19:28:26: Process with pid 6945 still not killed, retrying...
2016-08-22 19:28:26: Process with pid 6945 still not killed, retrying...
2016-08-22 19:28:26: Process with pid 6945 still not killed, retrying...
2016-08-22 19:28:26: Process with pid 6945 still not killed, retrying...
2016-08-22 19:28:26: Process with pid 6945 still not killed, retrying...
2016-08-22 19:28:26: Process with pid 6945 still not killed, retrying...
2016-08-22 19:28:26: Process with pid 6945 still not killed, retrying...
2016-08-22 19:28:27: Process with pid 6945 still not killed, retrying...
2016-08-22 19:28:27: Process with pid 6945 still not killed, retrying...
2016-08-22 19:28:27: Process with pid 6945 still not killed, retrying...
2016-08-22 19:28:27: Process with pid 6945 still not killed, retrying...
2016-08-22 19:28:27: Process with pid 6945 still not killed, retrying...
2016-08-22 19:28:27: Process with pid 6945 still not killed, retrying...
2016-08-22 19:28:27: Process with pid 6945 still alive after 1600ms, sending it SIGKILL now...
2016-08-22 19:28:27: App name:myapp id:1 disconnected
2016-08-22 19:28:27: App [myapp] with id [1] and pid [6945], exited with code [0] via signal [SIGKILL]
2016-08-22 19:28:27: [HandleExit] PM2 is being killed, stopping restart procedure...
2016-08-22 19:28:27: Stopping app:myapp-auth id:2
The text was updated successfully, but these errors were encountered:
@tjsail33 The problem looks like coming from the pid dir : PIDFile=/var/app/myapp/.pm2/pm2.pid, by default the pid file of pm2 is on ~/.pm2/pm2.pid. Could you test by replacing the pid file ?
Given the following inputs:
and
Expected behaviour
Systemd should recognize this service as being online.
Actual behaviour
$ sudo systemctl status pm2-myapp.service .snip. Active: inactive (dead) since Mon 2016-08-22 19:14:45 UTC; 4min 46s ago .snip.
Steps to reproduce
Software versions used
PM2 Log output
Use the command:
tail --lines 50 ~/.pm2/pm2.log
The text was updated successfully, but these errors were encountered: