- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - OpenVMS
- >
- use of synchronize in pipe command
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-06-2009 02:39 AM
02-06-2009 02:39 AM
I am trying to spawn a submit command and wait for the completion of the batch job from a C program. But for some reason I am unable to synchronize on the created batch entry. The following illustrates the problem from DCL.
$ sho sym $entry
%DCL-W-UNDSYM, undefined symbol - check validity and spelling
$ pipe submit/user=system t.com ; sho sym $entry ; sync/entr='$entry'
Job T (queue ITIV29_BATCH, entry 1085) started on ITIV29_BATCH
$ENTRY = "1085"
%DCL-W-VALREQ, missing qualifier or keyword value - supply all required values
$ sho sym $entry
$ENTRY = "1085"
$ sho entr 1085
Entry Jobname Username Blocks Status
----- ------- -------- ------ ------
1085 T SYSTEM Executing
On available batch queue ITIV29_BATCH
$
Any idea as to why the sync command doesn't get the value of the $entry symbol?
Thanks,
Oswald
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-06-2009 03:11 AM
02-06-2009 03:11 AM
Re: use of synchronize in pipe command
use the /symbol qualifier to preserve the symbols through the pipe.
HTH
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-06-2009 03:36 AM
02-06-2009 03:36 AM
SolutionSAP01_Roh. pip/sym sub/noprint/keep sc:a.com ; sh sym $entry ; synch /ent=&$entry
Job A (queue SAP01_BAT_QUE_7_1, entry 127) started on SAP01_BAT_QUE_7_1
$ENTRY = "127"
Job A (queue SAP01_BAT_QUE_7_1, entry 127) completed
SAP01_Roh.
instead.
regards Kalle
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-06-2009 03:37 AM
02-06-2009 03:37 AM
Re: use of synchronize in pipe command
According to help /symbol is default. Anyway i tried both pipe/symbol and pipe/nosymbol and the results are the same.
The weird thing is that the 'show symbol' command does show the $entry symbol while the 'sync' command apparently gets an empty string. Hence the VALREQ message.
Oswald
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-06-2009 03:39 AM
02-06-2009 03:39 AM
Re: use of synchronize in pipe command
Yes that's it. Thanks for your reply.
Still don't really understand as to what is happening here.
Oswald
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-06-2009 03:58 AM
02-06-2009 03:58 AM
Re: use of synchronize in pipe command
You have too use the & substitution:
; sync/entr=&$entry
and it will work.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-06-2009 04:03 AM
02-06-2009 04:03 AM
Re: use of synchronize in pipe command
Yes that explains it. Thanks.
Oswald
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-06-2009 04:05 AM
02-06-2009 04:05 AM
Re: use of synchronize in pipe command
Take a look at chapter 12.13 in Users Manual.
http://h71000.www7.hp.com/doc/731final/6489/6489pro_033.html#syn_phases
It's about how/when DCL do symbol substitutions.
/Hakan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-06-2009 04:08 AM
02-06-2009 04:08 AM
Re: use of synchronize in pipe command
The explanation:
The ' ' symbol substitution happens in the early DCL parsing phase (of the PIPE command): its value (or not existence) is taken at the beginning of the pipe command, before anything is executed.
The & substitution happens a stage later, when the sync command is parsed: at that time the $entry symbol has already the new value.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-06-2009 04:09 AM
02-06-2009 04:09 AM
Re: use of synchronize in pipe command
Thanks all.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-06-2009 04:21 AM
02-06-2009 04:21 AM
Re: use of synchronize in pipe command
Maybe this explains:
$ pipe subm tmp ; write sys$output "old ''$entry' new ", $entry
:
old 706 new 707
$ pipe subm tmp ; write sys$output "old ''$entry' new ", $entry
:
old 707 new 708
The substitution is normally done when the command is parsed.
The & operator postpones that until the variable is used.
It is also useful for case where the symbol contains non-printables or quotes notably in the command $READ/KEY=&key_value
hth,
Hein
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-06-2009 04:37 AM
02-06-2009 04:37 AM
Re: use of synchronize in pipe command
Same here.
I compiled answer, got distracted, came back, and _thought_ I checked to topic to see whether it would still be relevant, nothing _seemed_ changed so I submitted and found the topic was closed.
I used to mostly use IE6, but had switched to CHROME which apparently had different cache settings.
Groetjes,
Hein.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-06-2009 09:23 AM
02-06-2009 09:23 AM
Re: use of synchronize in pipe command
My question is why would you want to do this? IE, why would you want to start something in batch and then hang up your terminal until the batch job competes?
What if the batch job doesn't run immediately because there are no available batch processors? Then your session will be held up even longer!
It seems to me that you might as well just run it in your interactive session. You need the output of t.com in a file?
$ @T.COM/OUTPUT=T.LOG.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-08-2009 12:46 PM
02-08-2009 12:46 PM
Re: use of synchronize in pipe command
Perhaps it's unlikely, but there's one other issue you may want to deal with... if your batch entry completes before reaching the synchronize command, you'll get "%JBC-E-NOSUCHENT, no such entry". You can fix this with:
$ PIPE (SUBMIT/USER=SYSTEM T.COM/RETAIN=ALWAYS ; -
SYNCHRONIZE/ENTRY=&$ENTRY ; -
DELETE/ENTRY=&$ENTRY )
Note that this is also a convenient mechanism for determining the completion status of the batch job - it's $STATUS after the SYNCHRONIZE command.
I'm assuming this is part of a larger procedure... as written it's equivalent to
$ SUBMIT/USER=SYSTEM T.COM
$ SHOW SYM $ENTRY
$ SYMCHRONIZE/ENTRY=&$ENTRY
but without the symbol substitution issue. Or, maybe you're using PIPE just to put multiple commands on a single line from a call to LIB$SPAWN?
Your other option is to execute both the SUBMIT and SYNCHRONIZE directly from your C program. They're both fairly simple calls to $SNDJBC(W).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-08-2009 11:53 PM
02-08-2009 11:53 PM
Re: use of synchronize in pipe command
"My question is why would you want to do this? IE, why would you want to start something in batch and then hang up your terminal until the batch job competes?"
Actually I use a small C program installed with cmk privilege. This enables non-prived userd to perform some specific task which require elevated privs. The program lib$spawns the command in question.
Oswald
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-09-2009 01:32 PM
02-09-2009 01:32 PM
Re: use of synchronize in pipe command
> This enables non-prived userd to perform
>some specific task which require elevated
>privs. The program lib$spawns the command
>in question.
Yikes! In that case I would definitely STRONGLY recommend you replace your SPAWN with direct calls to $SNDJBCW. Consider what would happen if I ran your privileged program after executing something like:
$ SUBMIT="@SYS$LOGIN:MYTROJAN #"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-09-2009 11:47 PM
02-09-2009 11:47 PM
Re: use of synchronize in pipe command
I would start to worry about this the moment they figure out how to escape from their captivity.
All normal user accounts are captive on this system.
Oswald
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-10-2009 07:07 AM
02-10-2009 07:07 AM
Re: use of synchronize in pipe command
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-10-2009 12:53 PM
02-10-2009 12:53 PM
Re: use of synchronize in pipe command
> I don't understand why batch is
> involved at all.
The batch job is so the target procedure executes as SYSTEM, which is also why CMKRNL is required.
> how to escape from their captivity.
Oswald, there are many ways to get a symbol defined without necessarily escaping from a captive procedure. For example, is there a menu item for MAIL? or any way your users ever get into a text editor? What about network or batch mode access?
What if someone in the future gives them access to MAIL? Would they realise they've opened up a rather large and simple to exploit security hole?
My point is the mechanism you're using creates numerous potential exploits on your system which would allow otherwise non-privileged users to execute arbitrary commands with CMKRNL privilege. If you trust that they're truly captive, why not just grant them CMKRNL up front and avoid convoluted and tricky mechanisms to pretend your users aren't privileged?
In this case, the code to make your privileged image much safer is arguably simpler, faster and more reliable than using SPAWN.
Alternatively, just grant CMKRNL as an authorized privilege, you can skip the complexity, pitfalls and wider security risks of a privileged image. Just turn on CMKRNL, SUBMIT/USER, SYNCH then turn it off.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-11-2009 12:29 AM
02-11-2009 12:29 AM
Re: use of synchronize in pipe command
These users don't have mail/network or batch access. But i agree with you that $sndjbcw is better. I will look in to that.
A simple change in de submit command (change is to 'submit\' will also prevent using user defined symbols.
Thanks for the discussion,
Oswald
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-11-2009 03:52 AM
02-11-2009 03:52 AM
Re: use of synchronize in pipe command
Thanks all.
Oswald