Operating System - OpenVMS
1753300 Members
7599 Online
108792 Solutions
New Discussion юеВ

Re: Multiple default directories for an ID

 
Gregory Pagan
Occasional Advisor

Multiple default directories for an ID

I have a mixed alpha and itanium node cluster. The alpha nodes are running 8.3 and the itanium nodes are 8.3 1h1. The alpha nodes share a system disk and the itanium nodes share a different system disk but we also have a common disk that we run cluster wide stuff from.

I have a new need to have the default directory set in the authorize record changed depending on whether the ID is logging onto an Alpha or an Itanium node. I am trying to avoid creating another application ID if I can avoid it. The idea is to have the ID run a differnt login.com file depending on whether it is on an alpha node or an itanium node.

I tried puting this commonad in the sylogin.com file on the alpha nodes:

$ if f$extract(0,8,f$getjpi("","USERNAME")) .eqs. "ORACLE10"
$ then set default ora_appl:[oracle10]
$ ws ""
$ ws "Oracle10 default directory changed to ora_appl:[oracle10]
$ ws ""
$ endif

But it is not working, as when I get a command prompt and do a show default it still shows what is set in the authorize record.

Is there another way to accomplish this or am I going to have to set up and maintain a seperate account?

Any help would be greatly appreciated.

Greg
Why does this always happen to me?
15 REPLIES 15
John Gillings
Honored Contributor

Re: Multiple default directories for an ID

Greg,

Trust me, this is NOT a good idea! You'll have all kinds of issues from stuff which expects one user to have ONE login directory.

Just one example, MAIL. Where it gets delivered will depend on which node it's received on, but the new mail count is kept in a cluster common area. Net result is your newmail count will NEVER be correct on any node. Perhaps a minor and trivial issue, but just illustrating the kinds of things that can happen.

If you really want to, it's fairly easy to setup. On each node create yourself a concealed device, like this:

$ DEFINE/SYSTEM/EXEC USERS physdev:[USERDIR.]/TRANSLATION_ATTRIBUTES=(CONCEALED,TERMINAL)

(note that physdev MUST be a physical device name, like $1$DGA123:). Make the device different on each node if you want. Add the definitions to SYLOGICALS.COM

Now, define your UAF record with:

/DEVICE=USERS: /DIRECTORY=[YOURUSER]

So, SYS$LOGIN will be defined as USERS:[YOURUSER] which will map to different directories, depending on which node you login to. No need for any code in SYLOGIN or LOGIN.

(though, I repeat, most of the time people want to ELIMINATE this kind of difference)

If all you want to do is have a particular user SET DEFAULT to a different directory when they login to a particular node, I'd put it in the user's LOGIN.COM rather than SYLOGIN. Suppose your nodes are called ALPHA and IA64, try this:

$ node=F$GETSYI("NODENAME")
$ 'node'def="SYS$LOGIN"
$ ALPHAdef="ora_appl:[oracle10]"
$ IA64def="SYS$LOGIN"
$ OTHERdef="somedev:[OTHER]"
$ def='node'def
$ SET DEFAULT 'def'

Note that this code will do something sensible regardless of the node name, and is very easy to add additional nodes in future (like the example above OTHER).
A crucible of informative mistakes
Steven Schweda
Honored Contributor

Re: Multiple default directories for an ID

> I have a new need to have the default
> directory set in the authorize record
> changed depending on whether the ID is
> logging onto an Alpha or an Itanium node.

Why? What, exactly, will this do for you?
(Besides causing trouble, that is.)

As is often true, asking how to solve the
underlying problem can be more useful than
asking how to implement some particular
sub-ideal "solution" to that problem.
P Muralidhar Kini
Honored Contributor

Re: Multiple default directories for an ID

Hi Greg,

>> I have a new need to have the default directory set in the authorize record
>> changed depending on whether the ID is logging onto an Alpha or an
>> Itanium node.
>> The idea is to have the ID run a differnt login.com file depending on whether
>> it is on an alpha node or an itanium node.

If the need is only for Alpha and Itanium nodes to execute different LOGIN.COM
procedures, you can have a only one LOGIN.COM file per ID but then have that
LOGIN.COM file check whether the current node is Alpha or Ia64 and then
based on this execute different set of code.

Something like -
LOGIN.COM
...
$ IF F$GETSYI("ARCH_NAME") .EQS. "Alpha"
$ THEN
$ ! Alpha Code
$ ELSE
$ ! IA64 Code
$ ENDIF
...

Hope this helps.

Regards,
Murali
Let There Be Rock - AC/DC
John Gillings
Honored Contributor

Re: Multiple default directories for an ID

re: Murali,

$ IF F$GETSYI("ARCH_NAME") .EQS. "Alpha"
$ THEN
$ ! Alpha Code
$ ELSE
$ ! IA64 Code
$ ENDIF

ah, not quite... you could be on a VAX, or some future architecture. Since this kind of potentially incorrect assumption was probably THE biggest issue when migrating to IA64, I'd have hoped that everyone would be more vigilant about not committing it again.

$ arch=$GETSYI("ARCH_NAME")
$ IF arch.EQS. "Alpha"
$ THEN
$ ! Alpha Code
$ ELSE IF arch.EQS."IA64"
$ THEN
$ ! IA64 Code
$ ELSE IF arch.EQS."VAX"
$ THEN
$ ! VAX code
$ ELSE
$ ! Error - unexpected architecture
$ ENDIF
$ ENDIF
$ ENDIF

(assumption is the mother of all stuff ups)
A crucible of informative mistakes
Bob Blunt
Respected Contributor

Re: Multiple default directories for an ID

Greg, what's the real requirement here? Are you using separate databases or unique database versions on the different architectures? Trying to make sure that you only use Alpha executables on the Alpha and Itanium images on Itanium? One main reason for mixed architecture clusters is being able to share data so... it seems counter-productive to try and circumvent that feature.

bob
P Muralidhar Kini
Honored Contributor

Re: Multiple default directories for an ID

Hi John,

>> ah, not quite... you could be on a VAX, or some future architecture
Yes, thats a very good point.

The code that you have put up looks very neat especially the following part
>> $ ELSE
>> $ ! Error - unexpected architecture

I will keep that in mind. Thanks for pointing that out.

Regards,
Murali
Let There Be Rock - AC/DC
Jeremy Begg
Trusted Contributor

Re: Multiple default directories for an ID

Greg, bearing in mind all the warnings others have given you -- there is a way to do this.

What you need is a logical name which identifies the VMS disk and/or root directory for each architecture.

Then, in the SYSUAF, use that logical name as the default device for the user.

For example, if you want user JBLOGGS to log into DSA1:[ALPHA_USER.JBLOGGS] when logging into an AlphaServer, and DSA1:[IA64_USER.JBLOGGS] when logging into an Integrity server, you could set it up as follows:

1. In SYS$MANAGER:SYLOGICALS.COM or SYSTARTUP_VMS.COM, define a logical

$ define/sys/exec ORA_APPL -
DSA1:['f$getsyi("ARCH_NAME")'_USER.] -
/trans=(conc,term)

2. In AUTHORIZE set up the user:

$ mcr authorize modify JBLOGGS -
/dev=ORA_APPL:/dir=[JBLOGGS]

3. Create the two top-level directories.
4. Create the user's directory under each.

This arrangement will correctly set the user's login directory, SYS$LOGIN logical name, etc. at each login (batch, interactive or network).

As others have said, you need to think very carefully before going down this route.

Regards,
Jeremy Begg
abrsvc
Respected Contributor

Re: Multiple default directories for an ID

If the intent is to have a different "working" directory for each architecture, thena a variant on what has been described can work. Using logical names, insert into the login.com file a "set default working_dev" where working_dev is defined on each machine as a concealed device. This will mean that you have duplicate named directories on the "login" device and the "working" device.

An alternative would be to set up the environment based upon logical names that are contained in 2 different tables, one for each architecture. In this fashion the only change would be to determine which tables to use based upon the architecture. We use a similar idea where I am working now to create both production and test environments.

In order to determine which method would work, please describe exactly what the issues are that make you require 2 "login" directories.

Thanks,
Dan
Gregory Pagan
Occasional Advisor

Re: Multiple default directories for an ID

To all:

Thank you for all your replies and important reasons to not do what I proposed as well as ways to do it if I persist. Well, after reading through all the posts and giving more consideration to the ends I am trying to achieve I am going to go the two ID route.

I now see that as a much cleaner and easier to maintain path. I do appreaciate all your replies and your questions which lead me to what seems to be a better result.

Thanks again

Greg
Why does this always happen to me?