Запуск сценария оболочки с помощью диспетчера процессов pm2 - PullRequest
0 голосов
/ 23 апреля 2020

My Shell Script test_shell. sh

#!/bin/bash

echo hi

начиная с pm2 как pm2 start test_shell.sh

Состояние идентификатора процесса становится ошибочным после 15 перезапусков

CronJs-MacBook-Air-2:smart_vms_engine cronj$ pm2 ls
┌────────────┬────┬──────┬─────┬─────────┬─────────┬────────┬─────┬────────┬───────┬──────────┐
│ App name   │ id │ mode │ pid │ status  │ restart │ uptime │ cpu │ mem    │ user  │ watching │
├────────────┼────┼──────┼─────┼─────────┼─────────┼────────┼─────┼────────┼───────┼──────────┤
│ test_shell │ 0  │ fork │ 0   │ errored │ 15      │ 0      │ 0%  │ 0 B    │ cronj │ disabled │
└────────────┴────┴──────┴─────┴─────────┴─────────┴────────┴─────┴────────┴───────┴──────────┘

В журнале вывода ошибок ничего не печатается

[TAILING] Tailing last 15 lines for [0] process (change the value with --lines option)
/Users/cronj/.pm2/logs/test-shell-error-0.log last 15 lines:
/Users/cronj/.pm2/logs/test-shell-out-0.log last 15 lines:
0|test_she | hi
0|test_she | hi
0|test_she | hi
0|test_she | hi
0|test_she | hi
0|test_she | hi
0|test_she | hi
0|test_she | hi
0|test_she | hi
0|test_she | hi
0|test_she | hi
0|test_she | hi
0|test_she | hi
0|test_she | hi
0|test_she | hi

Как правильно запустить сценарий оболочки из pm2

...