Skip to content

Commit

Permalink
Merge pull request #548 from soyuka/master
Browse files Browse the repository at this point in the history
Fix #543
  • Loading branch information
Unitech committed Jul 2, 2014
2 parents 1e2a55a + 0a934f5 commit fcf6d9f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion lib/CLI.js
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,8 @@ CLI.startup = function(platform, opts, cb) {
printOut('/var/lock/subsys/pm2-init.sh lockfile has been added');
}
else {
cmd = 'chmod +x ' + INIT_SCRIPT + '; update-rc.d ' + p.basename(INIT_SCRIPT) + ' defaults';
// without beeing root, update-rc.d is not found
cmd = 'chmod +x ' + INIT_SCRIPT + ' && sudo update-rc.d ' + p.basename(INIT_SCRIPT) + ' defaults';
printOut(cst.PREFIX_MSG + '-ubuntu- Using the command %s', cmd);
}

Expand Down
2 changes: 1 addition & 1 deletion lib/scripts/pm2-init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export PATH=$PATH:%NODE_PATH%
export PM2_HOME="%HOME_PATH%"

super() {
sudo -Ei -u $USER PATH=$PATH $*
sudo -u $USER PATH=$PATH $*
}

start() {
Expand Down

0 comments on commit fcf6d9f

Please sign in to comment.