Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am trying to get a user data script working on EC2, Amazon Linux distro. The script does run, but for most commands, such as ec2-metadata or gem it complains about command not found. The tools are installed, and i can run them when I log in.

I guess, it has to do with the PATH not being set or something like that. How can I make the script behave as if I was running it in a shell?

Currently, I have started to work around with lines like the following, but it get's out of hand. /usr/local/rvm/bin/rvm default do bundle install

share|improve this question

Although not using Amazon Linux, I have managed to get my user script working without having to declare full paths by exporting PATH at the top of the file.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.