|
From: Erik R. <era...@gm...> - 2008-01-13 22:37:02
|
Im currently using JSW to start Hudson (a continuous integration
server) as a debian daemon. In order to not let build scripts do
anything, Ive enabled the RUN_AS_USER param in the "init.d" script.
This has worked as expected, files are created by the right user,
process runs by the expected use, whoami outputs the right user.
But yesterday when I tried to run "vncserver" in one build (to test
NUnit GUI), I noticed that it was trying to write to the root's home
path.
/usr/bin/vncserver :10 -depth 16
vncserver: Wrong type or access mode of /root/.vnc.
A little investigation showed that the env variable HOME is still
"/root", and not the path to the user's home. This must come from the
fact that the JSW init.d script executes "su -m $RUN_AS_USER -c
"\"$REALPATH\" $2"". The "-m" preserves the enviroment, which contains
the old HOME variable ("/root").
Is there a reason that JSW uses the "-m" parameter? Or should the
init.d script be extended so it sets the HOME variable to the correct
home path?
Any ideas on how to solve this?
regards
//Erik
|