avniproject / avni-infra

Other
0 stars 0 forks source link

Services running using pm2 do not restart on server reboot #31

Closed 1t5j0y closed 3 months ago

1t5j0y commented 4 months ago

rules-server, avni-media are run using pm2. If the instance on which these are running gets restarted, these services need to be configured to be restarted too.

Impacted sevices:

Environments:

himeshr commented 4 months ago

Refer to https://stackoverflow.com/questions/60095316/does-pm2-auto-restart-application-after-reboot-by-default on how to do this.

Balamuruganjeevi commented 3 months ago

I have checked the scripts for both avni-media and rules-server both are looking fine have all steps included init. @1t5j0y can you please review.

1t5j0y commented 3 months ago

@Balamuruganjeevi have you modified any code which needs to be reviewed? cc: @himeshr

Balamuruganjeevi commented 3 months ago

No nothing have changed and i have modified some code in avni-media yesterday but it won't work so i replaced it, so nothing changed.

1t5j0y commented 3 months ago

@Balamuruganjeevi since we have confirmed that the issue is present (atleast in avni-media) yesterday (simulated by rebooting prerelease integration server) and no change has been made, the issue won't be fixed and there is nothing to review. Moving this back to 'Ready' so someone else can take a look.

1t5j0y commented 3 months ago

avni-media had this issue because the command output by running pm2 startup (which creates the service to resurrect pm2 processes) was not being run. rules-server is getting restarted on server reboot as the avni-infra scripts already include this step.

1t5j0y commented 3 months ago

Tested on staging and prerelease by rebooting server and ensuring avni-media came back online as part of fix dev.