Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Upstart | Ubuntu | Nodejs | Can not run multiple exec inside script block

I'm trying to setup a upstart conf for my nodejs app. I have to run 2 script scrip_1.js and script_2.js. Here the conf

start on startup
stop on shutdown

respawn

console log

env PROJ=/project/path

script
    cd $PROJ
    exec node script_1.js 2>&1 >> $PROJ/logs/script_1.log
    exec node script_2.js 2>&1 >> $PROJ/logs/script_2.log
end script

The problem is only script_1.js running. If I move the exec node script_2.js... right before cd $PROJ then only script_2.js running.

How can I make this upstart conf?

Thank you!

like image 735
neo0 Avatar asked Feb 13 '23 10:02

neo0


1 Answers

Create a separate job for both script 1 and script 2.

like image 136
CameronNemo Avatar answered Feb 14 '23 23:02

CameronNemo