I'm really glad you brought up applic. It has a really nasty side effect.
There are two obvious ways to run a program from a WP:
1) dmcmd applic <pgm> <arg1>...<argn>
2) dmcmd run <pgm> <arg1>...<argn>
The first command writes the argument of applic to a named pipe on the
logical host of the WP. Attached to the named pipe is (basically) a Bourne
shell which reads the commands and executes them using the system(3s) call.
The second command causes the DM to fork into two processes. The second
(child) process
then execls into <pgm> and passes itself the arguments.
The main difference between the two appears to be that the first command
executes on the logical host of the WP and the second executes on the WP
itself.
However, there is another subtle difference and it can cause very
significant problems.
Remember that the first command is fed to a shell process and it uses
system(3s) to run the command? Well, what happens if the command does not
complete? For example, if it is used to run 'textedit' and the user never
quits textedit?
The answer is that no more commands are read from the named pipe until
textedit completes! No matter how many are sent or which WP sends it.
However, this does not stop other commands from being placed in the pipe!
Theoretically, the pipe could fill and cause visible problems on the DM/FV
side, but I've never seen that happen.
So, what happens to the users is:
1) Textedit starts.
2) Many other programs do not start.
3) Users call support because 'applic' does not work anymore! TAC works like
mad.
4) Textedit exits hours later quite by accident.
5) Lots of programs run when they are not supposed to and do bad things.
6) Everyone is confused and unhappy.
[How do I know? I had it happen in a major refinery. Fortunately, the
problems were minor, but...]
There are two ways to avoid this feature (and it might be for some
customers):
1) Put the & at the end of all commands that are invoked by applic. In your
example, you should
write:
:C0WP04DMCMD := "dmcmd applic /opt/home/frits/hello.scr &";
not
:C0WP04DMCMD := "dmcmd applic /opt/home/frits/hello.scr &";
2) Use
dmcmd run /bin/rexec $TMHST <pgm> <arg1> ... <argn>
I rather like the second one because I am quite likely to forget to add an
ampersand (&) to the end of
ALL of my applics. This failure would result in a subtle error. I hate
subtle errors!
Whereas, the second approach does not lend itself to subtle errors. Only
major ones which are easy to find ones.
So, your test program which is now out for all to see has two flaws:
1) Lack of error trapping and
2) The possibility of causing quite significant problems to each WP sharing
a host.
Now, aren't you sorry that I read this list? :)
BTW: This is all covered in my book. To bad, it is not published.
> -----Original Message-----
> From: Schouten, Frits JF [SMTP:[EMAIL PROTECTED]]
> Sent: Wednesday, March 22, 2000 6:16 PM
> To: 'Foxboro DCS Mail List'
> Subject: RE: Script Execution
>
> BTW I tried it to a WP in the following form and that worked also ok:
>
> :C0WP04DMCMD := "dmcmd applic /opt/home/frits/hello.scr";
>
> Looks like I can get my command to the AP after all :-))
>
> > -----Original Message-----
> > From: Ghantous, Ayoub [SMTP:[EMAIL PROTECTED]]
> > Sent: Thursday, 23 March 2000 10:15
> > To: Foxboro DCS Mail List
> > Subject: RE: Script Execution
> >
> > If C0AP01 is an AP rather than an AW, then the result you obtained is
> > expected.
> > The technique below applies to an AW but does not apply to an AP (as an
> AP
> > does not have a DM or DM globals).
> >
> > Regards,
> >
> > Ayoub Ghantous
> >
> >
-----------------------------------------------------------------------
This list is neither sponsored nor endorsed by the Foxboro Company. All
postings from this list are the work of list subscribers and no warranty
is made or implied as to the accuracy of any information disseminated
through this medium. By subscribing to this list you agree to hold the
list sponsor(s) blameless for any and all mishaps which might occur due to
your application of information received from this mailing list.
To be removed from this list, send mail to
[EMAIL PROTECTED]
with "unsubscribe foxboro" in the Subject. Or, send any mail to
[EMAIL PROTECTED]