Operating System - OpenVMS
1828038 Members
2491 Online
109973 Solutions
New Discussion

Detached process does not run, but no error indicated

 
John Popernack
Frequent Advisor

Re: Detached process does not run, but no error indicated

Jan-

I just started reading about using sys$system:loginout.exe. The book is not very clear on how this is done. In the description of SYS$CREPRC, it says "In creating a detached or subprocess, you can specify that the process run the image SYS$SYSTEM:LOGINOUT.EXE." Does this mean I can tell any detached process to run it before executing or is the process responsible for running it. Probably the latter is true. If so, how do I run LOGINOUT from the subprocess?

Thanks,
John
Dale A. Marcy
Trusted Contributor

Re: Detached process does not run, but no error indicated

You replace your executable with SYS$SYSTEM:LOGINOUT.EXE and specify an input command procedure that has the defines and the run command for your executable.

$ run/detached/input=/output=/error=/process_name= sys$system:loginout.exe
John Popernack
Frequent Advisor

Re: Detached process does not run, but no error indicated

Dale-

Thanks. I'll give that a try. I like this method because I don't have to change the way I define the logicals.

John
John Popernack
Frequent Advisor

Re: Detached process does not run, but no error indicated

Dale-

I tried that. I'm not sure why it didn't work. Here is exactly what I did.

Created test.com in sys$sysdevice:[sys0.users.popernack] with the following lines:

$ @login
$ r sd_iodr_demo

This directory has my login.com file that has all the necessary logicals defined. It also puts me in the proper directory (where the executable is located). sd_iodr_demo is the executable.

I entered the following command:

run/detach/process_name=demo/input=SYS$SYSDEVICE:[SYS0.USERS.POPERNACK]tes
t.com sys$system:loginout

I got a message that the process was created. The ACCOUNTING utility verified that it was created. The first line of code is a write statement similar to the one in the test program. The FOR051.DAT file was never created - checked our entire "OS" and "development" disks for the file (in case it wrote it somewhere I wasn't expecting).

Thanks,
John
Dale A. Marcy
Trusted Contributor

Re: Detached process does not run, but no error indicated

"Created test.com in sys$sysdevice:[sys0.users.popernack] with the following lines:

$ @login
$ r sd_iodr_demo"

With the detached process, I do not think it knows the default directory, so try modifying your command procedure to specify disk and directory for login and sd_iodr_demo.

John Popernack
Frequent Advisor

Re: Detached process does not run, but no error indicated

Dale-

I don't think the suprocess needs to have it defined in order to start the process, but I tried it anyway. Here's what I did:

SD1:: run/detach/process_name=demo/input=dkb0:[SYS0.USERS.POPERNACK]test.com -
_SD1:: dkb0:[sys0.syscommon.sysexe]loginout.exe

No logicals are used. I also modified test.com:

$! OPEN/WRITE test_out 'test.dat'
$! WRITE test_out 'started test.com'
$! CLOSE test_out
$ sd_disk = "DISK$SMARTDATA:"
$ sd_dir31 = f$fao("!AS!AS", sd_disk, "[SD31.]")
$ define/job/trans=concealed sd$root 'sd_dir31'
$ set def sd$root:[000000]

If I run test.com from the DCL prompt it starts the executable.

PS Can you tell what is wrong with the portion that is commented out? It does not write to test.dat (running @test from DCL).

Thanks,
John
John Popernack
Frequent Advisor

Re: Detached process does not run, but no error indicated

Dale-

The last line in test.com is still

$ r sd_iodr_demo

Thanks,
John
Dale A. Marcy
Trusted Contributor

Re: Detached process does not run, but no error indicated

I have been rushing my responses too quickly while trying to do other things. I was incorrect saying that it does not know default directory whenever you run loginout.exe. As for problems in the commented out section shown again below:

$! OPEN/WRITE test_out 'test.dat'
$! WRITE test_out 'started test.com'
$! CLOSE test_out


In the first line, remove the single quotes('). In the second line change the single quotes (') to the double quote character ("). Single quote to DCL means symbol substitution.
Dale A. Marcy
Trusted Contributor

Re: Detached process does not run, but no error indicated

What was the status on the accounting record for the detached process? You might want to specify the /full qualifier when output the accounting record.
John Popernack
Frequent Advisor

Re: Detached process does not run, but no error indicated

Dale-

Thanks. That worked. When I run test.com from dcl, it writes test.dat. If I run loginout.exe detached with test.com as input, the file is not written. This seems to indicate that test.com is not being run.

Thanks,
John
John Popernack
Frequent Advisor

Re: Detached process does not run, but no error indicated

Dale-

Every time I ran loginout.exe, it was logged by accounting.

Thanks,
John
John Popernack
Frequent Advisor

Re: Detached process does not run, but no error indicated

Dale-

I forgot to use the /full qualifier with the accounting utility. The final status text was:

%SYSTEM-F-NOLOGNAM, no logical name match

This was the status whether or not I used the logicals (sys$sysdevice, etc.). TEST.DAT was not created.

Also, I noticed it takes a while (30 seconds, maybe) for the entry to appear in ACCOUNTING. I checked for the PID immediately after running and it was not there. Is loginout waiting for a username / password and then timing out?

Thanks,
John
John Popernack
Frequent Advisor

Re: Detached process does not run, but no error indicated

I just learned about how to rate the answers. If I change them now, will that have an effect, or am I stuck with how I rated them?

Thanks,
John
Jan van den Ende
Honored Contributor

Re: Detached process does not run, but no error indicated

John,

now you specified:


SD1:: run/detach/process_name=demo/input=dkb0:[SYS0.USERS.POPERNACK]test.com -
_SD1:: dkb0:[sys0.syscommon.sysexe]loginout.exe


but in TEST.COM you do:


$! OPEN/WRITE test_out 'test.dat'
$! WRITE test_out 'started test.com'
$! CLOSE test_out
$ sd_disk = "DISK$SMARTDATA:"
$ sd_dir31 = f$fao("!AS!AS", sd_disk, "[SD31.]")
$ define/job/trans=concealed sd$root 'sd_dir31'
$ set def sd$root:[000000]
$ r sd_iodr_demo


Is DISK$SMARTDATA a _DISK_ device, or a concealed device of a directory _ON_ a disk device??

If the latter, _THAT_ is the problem! Concealed devices cannot be derived from concealed devices. (A looooong stranding request from me!).


BTW, is "SMART" here suggestive of the "SMARTSTAR" software?

hth.

Proost.

Have one on me.

Jan


Don't rust yours pelled jacker to fine doll missed aches.
John Popernack
Frequent Advisor

Re: Detached process does not run, but no error indicated

Jan-

I'm not sure of the proper terminology, but you can reference a physical device by specifying DISK$(volume name) which is what I have done. As far as I know, that is exactly that same as DK...

The company I work for is SmartData, so that is actually refering to our company name. I have never heard of SMARTSTAR. What does SMARTSTAR do?

Thanks,
John
John Popernack
Frequent Advisor

Re: Detached process does not run, but no error indicated

I found a solution that seems to work. Can you see any possible pitfalls with this?

I decided to keep everything exacly the same except define sd$root as /group instead of /job. I actually tried this early on and it didn't work. I had the executable linked /debug at the time - it cannot run detached with X-Windows debugger for obvious reasons. I changed that earlier, but never went back and retried defining the logicals with /group until now.

Thanks,
John
John Popernack
Frequent Advisor

Re: Detached process does not run, but no error indicated

I just read up on how to do the points, so I'll update and submit them now.

John
Jan van den Ende
Honored Contributor

Re: Detached process does not run, but no error indicated

John,

first of all: glad it is solved.


What does SMARTSTAR do


I only am system manager at a site that makes use of it, but as far as I know, it is a software product, that allows to define a 'relational shell' over a set of indexed RMS files, and than use (an) SQL (variant) on them; and it includes a relational Report Writer.
(Willem G.: correct me if I am wrong)


I just read up on how to do the points, so I'll update and submit them now.


Thanks, in the name of all that took part.

I would like to use the opportunity to address a minor point.
You did not assign points to all answers.
At a quick scan a think those are minor clarifications, so, if I am not mistaken, I assume you decided those did not merit extra points. That is totally OK, and fully your decision, _BUT_, it leaves those answers unassigned, in your profile statistics, and in the general Forum statistics.
There is an easy, and desired, cure:
if an answer deserves no points, you can assign 0 (zero) points. It only affects the 'unassigned' statistics, and it tells the poster that at least you have seen and evaluted the answer.

I noticed it was your first question.
An interesting one at that!
Hope to see you back regularly.

Proost.

Have one on me.

Jan
Don't rust yours pelled jacker to fine doll missed aches.
John Popernack
Frequent Advisor

Re: Detached process does not run, but no error indicated

All-

Thanks for all the help. This was an enjoyable experience.

Jan-

Thanks for the info on the points - you're right, I meant for those to be "N/A". I'll change them to 0 points.

John
John Popernack
Frequent Advisor

Re: Detached process does not run, but no error indicated

The detached processes required logicals that used to be defined system-wide. When the definition of these logicals changed from /system to /job, the detached process no longer had access to them. In order to avoid defining the logicals system-wide and still have them available to the detached process, I defined them /group. This required very minimal changes in this case.