Problem performing svn export using Hudson that run as a service
I have a script that perform a build as well as performing svn export. When I run hudson manually, by running it from a root user, I can do a build and svn export without a problem.
If I call hudson using a service (chkconfig), hudson runs okay. SVN checkout (assume this is URL1) is also fine since the credential is stored in hudson config. However, when my script tries to perform svn export (different from URL1; let's say this is URL2), it always fail. It says "Password for 'root': Authentication realm". This is basically error because my build server cannot provide the necessary credential to login into svn. This is what I don't understand, because I store the svn credential in my root account, and have no problem performing svn update/svn info to URL2 from the shell or when I start开发者_Go百科 hudson manually (not as service).
My guess right now is that when we are running an app as a service, it does not load some/all stored user configurations? Any idea how can I force the service to load my svn credential? Any other solution/insight is also welcome.
Btw, my build server is running Red Hat 5.6
Thanks!!!
Can't give you a detailed answer, but one of the differences between an interactive shell and when running as a service is the first starts up by reading ~/.bash_profile, while the second runs ~/.bashrc Try to compare the two!
Comparing the output of env
in both contexts (within hudson and within your shell) should help you troubleshoot this.
By default, SVN stores user credential in their corresponding home directory. When a server is restarted, it will not load your profile (in my case, /etc/profile) as pointed by Tobu. So to solve this problem, we simply need to set the HOME folder to the correct location. Modify your service script for your apps to include the following line:
HOME=/<<user home folder location>>
This solves my problem.
精彩评论