Best way to trigger system commands
I want to trigger a system command on the master node at the end of a workunit. I remember seeing a function which will call a particular command on a node but I can not recollect where I saw it. Anyone remembers?
- sbagaria
- Community Advisory Board Member
- Posts: 92
- Joined: Thu Jul 05, 2012 9:23 pm
The ECL action to trigger an event is NOTIFY. This will trigger the event that a scheduled workunit can be set to wait for. .
You can find more details in the ECL Scheduler guide:
http://hpccsystems.com/download/docs/ecl-scheduler
The example on page 12 of this guide shows a good example.
To run a system command, use the standard library function: CmdProcess
For example:
HTH,
Jim
You can find more details in the ECL Scheduler guide:
http://hpccsystems.com/download/docs/ecl-scheduler
The example on page 12 of this guide shows a good example.
To run a system command, use the standard library function: CmdProcess
For example:
- Code: Select all
STD.System.Util.CmdProcess('echo','George Jetson');
HTH,
Jim
- JimD
- Posts: 160
- Joined: Wed May 18, 2011 1:35 pm
Thanks. Unfortunately, the CmdProcess function is not working for me. The workunits do not terminate. The last line in the eclagent log says 'Obtained run lock'. Both for hthor and thor. Roxie also does not terminate but I don't have a log entry for roxie.
Pipe on the other hand works fine but it executes on the slave nodes whereas I want the command to be executed on the master node only.
Pipe on the other hand works fine but it executes on the slave nodes whereas I want the command to be executed on the master node only.
- sbagaria
- Community Advisory Board Member
- Posts: 92
- Joined: Thu Jul 05, 2012 9:23 pm
There is no active issue (bug) reported for CmdProcess currently, if you are unable to use it you probably need to open an issue in the Community Issue Tracker, and include a code sample if it is reproducable.
Are you getting this lock on the simple echo command that Jim posted, or are you trying to run something else?
Thanks,
Bob
Are you getting this lock on the simple echo command that Jim posted, or are you trying to run something else?
Thanks,
Bob
- bforeman
- Community Advisory Board Member
- Posts: 1006
- Joined: Wed Jun 29, 2011 7:13 pm
It's the same command as Jim posted. I tried it on 4.0.0rc5 running on Ubuntu and 3.10.4-1 running on CentOS. I will log a Jira item.
- sbagaria
- Community Advisory Board Member
- Posts: 92
- Joined: Thu Jul 05, 2012 9:23 pm
Diagnosed the problem. Use the absolute path for the command. Also, the example you provided will not return anything as at least in Linux, echo repeats its arguments and not the standard input. cat was built to repeat standard input. So the correct example would be Std.System.Utils.CmdProcess('cat','George Jetson');
See issues
https://track.hpccsystems.com/browse/HPCC-9226
https://track.hpccsystems.com/browse/HPCC-9227
See issues
https://track.hpccsystems.com/browse/HPCC-9226
https://track.hpccsystems.com/browse/HPCC-9227
- sbagaria
- Community Advisory Board Member
- Posts: 92
- Joined: Thu Jul 05, 2012 9:23 pm
As noted in the above Jira items, this is now resolved for 3.10.8.
- sbagaria
- Community Advisory Board Member
- Posts: 92
- Joined: Thu Jul 05, 2012 9:23 pm
Thanks for the feedback, regarding the absolute path issue, ww will review the documentation and update as needed. Again, thanks very much!
Bob
Bob
- bforeman
- Community Advisory Board Member
- Posts: 1006
- Joined: Wed Jun 29, 2011 7:13 pm
Noticed this was a cross-post: viewtopic.php?f=8&t=581
Also, the absolute path will only be needed for versions prior to 3.10.8. 3.10.8 and onwards will be able to search the standard path variable. If you are updating the doc, then please change the example to refer 'cat' instead of 'echo'.
Thanks
Also, the absolute path will only be needed for versions prior to 3.10.8. 3.10.8 and onwards will be able to search the standard path variable. If you are updating the doc, then please change the example to refer 'cat' instead of 'echo'.
Thanks

- sbagaria
- Community Advisory Board Member
- Posts: 92
- Joined: Thu Jul 05, 2012 9:23 pm
9 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 1 guest