Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use "pwd -P" instead of "pwd" in etc/init.d scripts #321

Open
craigmcchesney opened this issue Jun 28, 2022 · 0 comments
Open

use "pwd -P" instead of "pwd" in etc/init.d scripts #321

craigmcchesney opened this issue Jun 28, 2022 · 0 comments

Comments

@craigmcchesney
Copy link

It took me a long time to figure this out, but if I use a symbolic link pointing to the deployment directory (e.g., /opt/traveler/current) instead of the directory itself (/opt/traveler/traveler-APS-1.5.5), the scripts fail due to module resolution errors.

For example, if I run "./etc/init.d/traveler-webapp stop" from /opt//traveler/current it fails with the error "[PM2][ERROR] Process or Namespace /opt/traveler/current/app.js not found", but it works if I run it from /opt/traveler/traveler-APS-1.5.5.

I tested that changing:
MY_DIR=dirname $0
CUR_DIR=pwd
cd $MY_DIR
MY_DIR=pwd
cd $CUR_DIR

to:
MY_DIR=dirname $0
CUR_DIR=pwd -P
cd $MY_DIR
MY_DIR=pwd -P
cd $CUR_DIR

solves the problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant