File tree 4 files changed +29
-1
lines changed
4 files changed +29
-1
lines changed Original file line number Diff line number Diff line change 11
11
- #3273 pm2 --mini-list now print the right pid file
12
12
- #3206 add flag to auto turn off auto exit with pm2-docker
13
13
- #3036 Fix applying env PM2_CONCURRENT_ACTIONS correctly
14
+ - #3346 do not chmod systemd script (was failing systemd script on orange pi)
15
+ - #3347 Add --wait-ip option to override systemd initialization to wait for internet full connectivity
14
16
15
17
## 2.8.0
16
18
Original file line number Diff line number Diff line change @@ -54,6 +54,7 @@ commander.version(pkg.version)
54
54
. option ( '--gid <gid>' , 'run target script with <gid> rights' )
55
55
. option ( '--cwd <path>' , 'run target script as <username>' )
56
56
. option ( '--hp <home path>' , 'define home path when generating startup script' )
57
+ . option ( '--wait-ip' , 'override systemd script to wait for full internet connectivity to launch pm2' )
57
58
. option ( '--service-name <name>' , 'define service name when generating startup script' )
58
59
. option ( '-c --cron <cron_pattern>' , 'restart a running process based on a cron pattern' )
59
60
. option ( '-w --write' , 'write configuration in local folder' )
Original file line number Diff line number Diff line change @@ -217,7 +217,10 @@ module.exports = function(CLI) {
217
217
case 'arch' :
218
218
case 'oracle' :
219
219
case 'systemd' :
220
- template = getTemplate ( 'systemd' ) ;
220
+ if ( opts . waitIp )
221
+ template = getTemplate ( 'systemd-online' ) ;
222
+ else
223
+ template = getTemplate ( 'systemd' ) ;
221
224
destination = '/etc/systemd/system/' + service_name + '.service' ;
222
225
commands = [
223
226
'systemctl enable ' + service_name ,
Original file line number Diff line number Diff line change
1
+ [Unit]
2
+ Description=PM2 process manager
3
+ Documentation=https://pm2.keymetrics.io/
4
+ After=network.target network-online.target
5
+ Wants=network-online.target
6
+
7
+ [Service]
8
+ Type=forking
9
+ User=%USER%
10
+ LimitNOFILE=infinity
11
+ LimitNPROC=infinity
12
+ LimitCORE=infinity
13
+ Environment=PATH=%NODE_PATH%:/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin
14
+ Environment=PM2_HOME=%HOME_PATH%
15
+ PIDFile=%HOME_PATH%/pm2.pid
16
+
17
+ ExecStart=%PM2_PATH% resurrect
18
+ ExecReload=%PM2_PATH% reload all
19
+ ExecStop=%PM2_PATH% kill
20
+
21
+ [Install]
22
+ WantedBy=multi-user.target network-online.target
You can’t perform that action at this time.
0 commit comments