1827807 Members
2767 Online
109969 Solutions
New Discussion

Re: Detached processes

 
Wim Van den Wyngaert
Honored Contributor

Detached processes

I have a process running under the SYSTEM account. Now I want to create a detached process under the XXX account AND one that has executed the login.com of the XXX account.

I only want to know if this is posible with the run command (process). Not interrested in other solutions.

Wim
Wim
15 REPLIES 15
Wim Van den Wyngaert
Honored Contributor

Re: Detached processes

While on the subject :
run loginout /inp/outp/detach/auth

If I remove the /auth I get the same kind of process (logicals, quotas). What is the logic of this ? Is /auth added if /deta is used ? Or is it because loginout creates a new process and always uses /auth to create them ?

Wim (confused)
Wim
Lokesh_2
Esteemed Contributor

Re: Detached processes

How about /UIC qualifier.

From help of Run/detach :

Creates a detached process with the same user identification code
(UIC) as the current process. (To create a detached process with
a different UIC, use the /UIC qualifier.)

Thanks & regards,
Lokesh Jain
What would you do with your life if you knew you could not fail?
Wim Van den Wyngaert
Honored Contributor

Re: Detached processes

Lokesh

Nope. Tested it and login.com was not executed.

Wim
Wim
Lokesh_2
Esteemed Contributor

Re: Detached processes

Hi Wim,

When you run it without /uic , then do it execute login.com of default UIC ?

Thanks & regards,
Lokesh
What would you do with your life if you knew you could not fail?
Wim Van den Wyngaert
Honored Contributor

Re: Detached processes

Lokesh,

My finding are (for running loginout):
1) If /uic is used, the process user will still be the original user, the uic will
be set to the specified value and sylogin is executed. The login of the user is
not done, unless the uic matches the current user.

2) If /auth is used, the /uic is ignored and a full login is done for the current
user.

3) /detach means /uic=current_uic

4) /auth makes all /quotas and /uic to be ignored

Wim
Wim
Ian Miller.
Honored Contributor

Re: Detached processes

I think you have to create a DCL procedure containing the RUN command of the image - say its called ABC.COM

RUN/DET/INP=ABC.COM/UIC=[X,Y]/AUTH/OUT=ABC.LOG SYS$SYSTEM:LOGINOUT.EXE

this will get you are process with the correct uic and with DCL included. I don't think it would have ran the LOGIN.COM but you can add this to the DCL.

I think the username will be yours
____________________
Purely Personal Opinion
Wim Van den Wyngaert
Honored Contributor

Re: Detached processes

Ian,

That is just what I don't want. I want to be able to start it automatically ...

Wim
Wim
Antoniov.
Honored Contributor

Re: Detached processes

Wim,
I've tryed in past this without success :-(
So I've solved running a batch process with specific user: it isn't the same but helped me.
I'm interesting in this solution, if somebody can help you.

Antonio Vigliotti
Antonio Maria Vigliotti
Willem Grooters
Honored Contributor

Re: Detached processes

Wim,

from the deepest abysses in my memory - way back to VAX and VMS 4.something, I remember at that time LOGIN.COM (and SYLOGIN.COM) had to be excuted in the commandprocedure. RUN/DETACH did at that time not execute any login procedure, you had to program the invokation yourself.

I know VMS has eveolved, and this probably as well. But it might be a solution to the problem, at least part of it.

Willem
Willem Grooters
OpenVMS Developer & System Manager
Peter Hofman
Frequent Advisor

Re: Detached processes

My first idea was to modify SYLOGIN.COM to search for a file SYS$LOGIN:LOGIN_DETACHED.COM in which the users login procedure would be executed.

Of course this would be too easy :-(

I tried it with some extra commands in SYLOGIN.COM to make some extra checks.

This is why it won't work:
when I start a detached process as user SYSTEM with /UIC=XXX, even the SYS$LOGIN logical will still point to the login directory of user SYSTEM.

You could of course get the right login procedure and path from SYSUAF in some way.

I would go for the batch process as suggested in another answer. I use it a lot.
David B Sneddon
Honored Contributor

Re: Detached processes

Wim,

Is the original process (running as SYSTEM) running
a program or just some DCL?
We have this situation here. Our solution...
The "monitor" process is running detached and
when it needs to start another detached process
under a different username it uses the $PERSONA
system services to become the user, then uses
$CREPRC to create a process running LOGINOUT and
supplying a procedure that runs the final image.


Regards
Dave
John Gillings
Honored Contributor

Re: Detached processes

Wim,

Without resorting to persona services, there is really only ONE supported way to start any process under a different USERNAME and that's SUBMIT/USER=other-user

RUN/UIC does NOT change the username, it just changes the UIC. To get a detached process in another username, put your RUN/DETACHED command into a procedure and SUBMIT/USER it with the required username.

It doesn't matter how much you want to argue about this, or complain, if you want a supported solution, SUBMIT/USER is IT, period! Many people have built complex privileged code to try and adjust all the data structures required to switch username, but they ALWAYS break with new versions (which usually means a system crash), and they rarely get all the bits that are required anyway.

Note that even persona services don't really give you a true change in username. They're really designed to be used by a server process to behave "as if" it were running as a different username. That's subtly different from actually "being" that username.

/AUTHORIZE only does anything if the image is LOGINOUT.EXE. If it is included, MOST of the other qualifiers are overridden by the UAF values of the CURRENT USERNAME. UIC isn't actually ignored, the process starts out with the UIC you specify, but it gets overridden by the UIC from the UAF record (same for quotas and process name).
A crucible of informative mistakes
Wim Van den Wyngaert
Honored Contributor

Re: Detached processes

All,

Extra findings : when using /uic sylogin.com IS executed.

Isn't it a pitty that DCL can't do something that every U*** can ? Some work for engineering ...

Wim
Wim
Cass Witkowski
Trusted Contributor

Re: Detached processes

Does the job have to be detached? Would a batch job work just as well? If do you could use the submit/user=xxx command
Martin P.J. Zinser
Honored Contributor

Re: Detached processes

Hello Wim,

since it seems what you want is not available right now, how about a tool to make the
submit/user more comfortable? Hunter has a tool called job_daemon for this purpose:

http://vms.process.com/scripts/fileserv/fileserv_search.exe?package=job_daemon&description=&author=&system=Either&language=All

Greetings, Martin