[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Environment Variables for sudo



Hi All,

am having a bit of a problem with setting environment variables on my web server. I need to set the following, for all users, including root.

i have added the following to /etc/profile, /etc/bash.bashrc, / root/.profile and /root/.bashrc:

export PATH=$PATH:/usr/local/java/j2sdk/bin
export JAVA_HOME=/usr/local/java/j2sdk
export CATALINA_HOME=/usr/local/java/apache-tomcat

this works fine for normal users (and for root when using su, which i had disabled), but apparently not for root (via sudo).

the output from a 'sudo env' is this:

TERM=vt100
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/ usr/X11R6/bin
LOGNAME=root
USER=root
SUDO_COMMAND=/usr/bin/env
SUDO_USER=tim
SUDO_UID=1000
SUDO_GID=1000


could anyone enlighten me on where sudo gets its environment variables from, as it apparently is not in /root, as i expected! any ideas what i might be doing wrong / overlooking?

many thanks,


Tim







Reply to: