Skip to content

Do not source .bash_profile.acs too early #37

@dneise

Description

@dneise

I just an into this issue:

Never source /alma/.../.bash_profile.acs before defining INTROOT and so on.

We source the .bash_profile.acs too early inside /etc/bashrc.

echo "source $ACS_ROOT/ACSSW/config/.acs/.bash_profile.acs" >> /etc/bashrc

So any user, who logs in and

  • creates INTROOT and ACSDATA (e.g. via getTemplateForDirectory)
  • then exports INTROOT and ACSDATA
  • and then sources the .bash_profile.acs again to make sure the exports take effect

Will end up with a horrible mess.
E.g. the env var ACS_TMP will not be redefined, since:

if [ X"$ACS_TMP" = X ] || [ X"$ACS_RETAIN" = X ]
then
	if [ "$OSYSTEM" = "$CYGWIN_VER" ]
	then
       ACS_TMP=$ACSDATA/tmp/`hostname`
	else
       ACS_TMP=$ACSDATA/tmp/`hostname -s`
	fi
fi

Which means .. if ACS_TMP already has a value (even when it it a wrong value) sourcing the bash_profile again will not reset ACS_TMP ... it will simply happily contain a wrong value forever.
This is highly surprising behaviour in my opinion, but we cannot fix it here.

However, we must not do this:

Instead I propose to create a symlink in /alma named .bash_profile.acs which points to $ACS_ROOT/ACSSW/config/.acs/.bash_profile.acs

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions