Keywords: MEAN - Google Cloud Platform - How to - Other
I had installed mean stack, added couple of thing and not I want to disable apache to run on startup. I had created 2 scripts.
Description=pm2 app autostart
which I added to systemd to run on startup. And the second script startup.sh:
case "$1" in
/opt/bitnami/ctlscript.sh stop apache
/opt/bitnami/nodejs/bin/pm2 start /home/mee/app/app2.json
/opt/bitnami/nodejs/bin/pm2 stop all
/opt/bitnami/nodejs/bin/pm2 restart all
So the script should stop just apache ( and I can see in systemd logs that indeed it is not running). Then it should start pm2 conf.json with my app and occupy port 80 before apache starts/restart ( at least thats my idea).
But I keep failing to produce this result. I can see that my scripts were running but at the end of logs pm2 instance is shut down and httpd.bin is spawned...