From 3ef3b9ca8e2eaa4d8c394c0642e3c566a91a554e Mon Sep 17 00:00:00 2001 From: Girish Ramakrishnan Date: Thu, 19 Nov 2015 01:44:07 -0800 Subject: [PATCH] run pm2 as normal user --- prepareDeployTarget.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/prepareDeployTarget.sh b/prepareDeployTarget.sh index f92b3fd..22b44e1 100644 --- a/prepareDeployTarget.sh +++ b/prepareDeployTarget.sh @@ -105,10 +105,10 @@ touch "${ECOSYSTEM}" chown -R $USER:$USER /home/$USER # run pm2 as current user ubuntu to avoid pm2 running as root below -pm2 status +sudo -u $USER pm2 status # ensure we run the latest version, this might not be the case if this script is ran against a already prepared server -pm2 updatePM2 +sudo -u $USER pm2 updatePM2 # setup the init scripts pm2 startup -u $USER