Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
External task - System Command problem
System
Below is a perl script which we want to run in an external task. It should supposedly call rsh.exe and return. When this script is called within an external task, the return value from the execution of rsh.exe command is 256 - It does not work! I strip out the workflow related parts from the ipl and run the script from the command line; this time the return code is 0 and everything works as expected. What may be causing the script to fail when it is run from within the workflow? Thanks.
#!c:\iw-home/iw-perl/bin/iwperl
######################################################################
#
# systemcommand.ipl
#
# This script executes rsh.exe
#
######################################################################
use TeamSite::WFtask;
my $iwhome = `iwgethome`;
$iwhome =~ s/[\n\r]+$//;
my $task = new TeamSite::WFtask($ARGV[1]);
open (LOG, ">$iwhome/tmp/systemcommand.log");
if ($task->IsValid())
{
print LOG "BEFORE\n";
$cmd = "c:\\winnt\\system32\\rsh.exe";
$par = "akportdev -l haluk touch test.txt";
print LOG "cmd: $cmd\n";
print LOG "par: $par\n";
$retval = system($cmd);
print LOG "Return Value: $retval\n";
print LOG "AFTER\n";
$task->CallBack(0, "Finished $cmd");
}
Find more posts tagged with
Comments
james1
It may have to do with the fact that, on Windows, all external tasks run under the Local System account, which may not have access to the network resources required by "rsh.exe".
-- James
--
James H Koh
Interwoven Engineering
log_file_PDF.txt
Migrateduser
You might get more information if you log the output of running the command:
print LOG "COMMAND : ", ${cmd}, "\n";
print LOG `${cmd} 2>&1`;
print LOG "RETURNED : ", $?, "\n";
instead of
$retval = system($cmd);
Edited by john on 10/30/03 09:13 AM (server time).
Johnny
Just jumping on the side here, but is there a reason for the difference between the two platforms?..
Can you explain why external tasks need to run as the local system account rather than the user assigned to the task itself?
I guess for my purpose when a workflow is generating pages, in the GUI they are all stamped as SYSTEM rather than the user who ran the task. It would be good to know if there is way to achieve this.
John Cuiuli
james1
I believe that the problem is that under Windows, in order for a program to act as a particular user, it needs valid credentials for that user, which I believe requires that user's password. When a user logs in to the TeamSite UI, TeamSite then has that user's password and at that time can do things as that user. Conversely, when an external task is kicked off, the user is not at that time necessarily interacting with the system, so the workflow engine cannot expect to have that user's password.
Under UNIX, since the workflow engine runs as the superuser, it can impersonate any other system user that it wants to.
-- James
--
James H Koh
Interwoven Engineering
Johnny
Thanks for that James. Makes perfect sense.
I've been wondering all this time
It would be good to find a workaround for stamping the files though.
John Cuiuli
rwinterpacht
I've been having a similar problem trying to run OpenDeploy on Solaris. I wrote the output to a temp file...when called from the workflow, I get a core dump! But calling the same command (copy/paste from log file) it runs just fine...strange...
COMMAND : /opt/OpenDeployNG/bin/iwodstart iw.credit_services.content.dev -k definition=APP_DEF -k filelist=/tmp/appDeploylist_3315 -k srcArea=/default/main/content_management_projects/credit_services/content/EDITION/ed_0003 -k repfarm=REPFARM_APP_IST_QA
Segmentation Fault - core dumped
RETURNED : 35584
Running from the command prompt:
empc55@briw3>/opt/OpenDeployNG/bin/iwodstart iw.credit_services.content.dev -k definition=APP_DEF -k filelist=/tmp/appDeplo>
Locating OpenDeploy service.
OpenDeploy server host: localhost, RMI registry port: 9173
Got OpenDeploy service.
>>>>>-- Start deployment iw.credit_services.content.dev.
iwodstart running in default synchronous mode.
Need to wait for deployment to complete.
>>>>>-- Deployment iw.credit_services.content.dev finished:
ID: m20 Start time: Wed Nov 05 17:12:55 EST 2003
Status: Completed
What does the return value of "35584" mean? Is there a reference for returned values from OpenDeploy?
Thanks,
Raf Winterpacht
Household Intl
nipper
what rev of OD ? Is there a core file ?
THere was a bug in 5.5.1 when OD was invoked via WF on solaris, that the java invokation had too many file descriptors open and there would be a ksh core file.
Fixed in 5.6
rwinterpacht
Oooh that's interesting. We're using 5.5.1, but it's called by downRev to 4.5.2 in production, I'm testing it out now for running it is just 5.5.1 deploying to 5.5.1. So maybe the 5.6 would fix this. I'll test it out and see. As far as the core dump file, I don't know where to find it, what's the pwd when root calls an externaltask from a workflow?
Thanks for the help,
Raf
nipper
never found them in a consistant place. Run this command.
find / -name core -mtime -3 -print
That will print out core files created in the last 3 days.
do a file on each, if it says ksh it is a likely suspect.
dootndo2
When you call:
system($cmd);
This is where the failure is.
You need to call:
system("$cmd");
Hope this helps.
SP4 R2 Gateway Port_Services.doc
jbonifaci
dootndo2,
Not only are you a year and a half late on this, you are completely wrong. It does not matter if you use quotes or don't use quotes. I would imagine not using quotes would perform slightly faster if anything.
Jeff
Johnny
oh boy
John Cuiuli
iwovGraduate
yet another case of too much crack ?
log_file_PDF.txt
nipper
I just thought he was an Aussie
jbonifaci
Definitely too much crack,
.
Johnny
Careful, this is Aussie is close enough to whack you
John Cuiuli
nipper
Close enough, only 3000 miles away. Big enough, never.
Johnny
hmm well it's a good point, but compared to last year.. I'm right next door!
John Cuiuli