04-16-2008 06:42 AM
We have several boxes mostly(11.11) where the helpdesk users see a menu when they log in.
The main scriptA check the user, exports the variables etc. This calls another scriptB which displays the menu. Script B then calls whichever script is needed depending upon the menu selection.
On a new machine however (11.23) when scriptB calls the final script the last script has lost the variables.
I have an echo at each point in the scripts the variables are set correctly in Script A and Script B, but get lost at the 3rd level
What is happeneing?
04-16-2008 07:53 AM
The script works fine on other machines thanks.... :-/ I was wondering whether something in 11.23 only carries variables down so many new shells are something silly like that.
Yes the scripts / directories are the same.
04-16-2008 08:09 AM
can you post an extract from your script so that we get a clearer picture?
04-16-2008 08:18 AM
> I was wondering whether something in 11.23 only carries variables down so many new shells are something silly like that.
I don't think that this has anything to due intrinsically with 11.11 vs. 11.23, but rather something with configuration.
> Yes the scripts / directories are the same.
Same permissions and ownerships? Same permissions and ownerships of parent directories (all the way up)?
> On a new machine however (11.23) when scriptB calls the final script the last script has lost the variables.
Does scriptB export what the final script will need?
Do you launch the menu script from a '.profile' or do you define it as the shell program in '/etc/passwd'? Is this done the same on all systems?
Lastly, if you a performing any 'su' commands, compare your '/etc/default/security' settings on your servers. In particular, look at settings like 'SU_KEEP_ENV_VARS', 'SU_ROOT_GROUP' and 'SU_DEFAULT_PATH'.
04-16-2008 08:31 AM
This is hashed on the box that doesnt work
# Force su to propagate specified unsafe
# environment variables.
ill have a check around the working boxes.
04-16-2008 08:37 AM
the final script is kicked off via sudo though so I think we are along the right lines.