Skip to content
This repository has been archived by the owner on Jul 30, 2018. It is now read-only.

Could setuser tool run a service like a login user? #16

Open
xfyuan opened this issue Nov 9, 2015 · 0 comments
Open

Could setuser tool run a service like a login user? #16

xfyuan opened this issue Nov 9, 2015 · 0 comments

Comments

@xfyuan
Copy link

xfyuan commented Nov 9, 2015

I use gocd agent to build a CI machine demo, and found it uses setuser tool to run CI service with a seperated user, for example 'testci'. My application is a Rails app. The CI server needs a ruby env to run each test. I have installed rvm for user 'testci', and use these commands to check, the ruby env is OK:

(I use docker compose, docker name is 'ci')

docker-compose run ci bash
su - testci
ruby -v

output is 'ruby 2.2.3p173 (2015-08-18 revision 51636) [x86_64-linux]', ruby does works.

But the problem is when the CI run each test, it always can't found ruby. Because the rvm config is be written in .bash_profile, a logined user can read it correctly so all ok, I guess setuser tool maybe didn't read .bash_profile then ruby not works.

Did I missed or ignored something? and I want to know the setuser tool can run a service like a real logined user?

In fact, my problem is how to add the ruby env in gocd agent correctly?

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

No branches or pull requests

1 participant