APM: Process/System questions

Bakken, Tom - Temple, TX tom.bakken at tx.usda.gov
Thu Sep 23 09:21:17 CDT 2004


That did the trick.  The system command would wait until shutdown.exe
gracefully exited.  The bug in windows prevented it from doing that, so
the entire program would stall.  Using back ticks doesn't wait for a
graceful exit worked great.  

Thanks for the help.

Tom Bakken
Information Resource Manager
Texas USDA, Rural Development 

-----Original Message-----
From: ezra pagel [mailto:ezra at jdba.org] 
Sent: Friday, September 17, 2004 11:43 AM
To: Bakken, Tom - Temple, TX
Cc: austin at mail.pm.org
Subject: Re: APM: Process/System questions


Using backticks/qx instead of system() will let you capture standard 
output; you can redirect stderr if you need it. You can still check $? 
for the system exit code.

Bakken, Tom - Temple, TX wrote:

>Some time ago I posted a problem I was having with a script that was
>supposed to restart workstations but stalled when it hit certain PCs.
I
>used Bill Raty's suggestion of the spawn subroutine.   I wasn't able to
>get it to work and put it aside until I recently had more time and now
>seem to have gotten it running.
>
>Shutdown.exe has a known bug where if the workstation that's to be shut
>down is at the Windows login screen, it will lock up.  Bill's solution
>works around that problem by waiting 20 seconds and then continuing if
>the workstation stalls.  Unfortunately, the system command returns a 0
>exit status for success even if shutdown.exe stalls.  Is there any way
>to capture the output from shutdown.exe which is "the device is not
>ready"?  Either that or if the script does wait 20 seconds and fails,
>can I test for that somehow?
>  
>
<snip>

-- 

-------------------------------------------------------
Ezra Pagel, Software Engineer
Austin Logistics, Inc.
Office: 512-651-5644
Mobile: 512-694-1107
epagel at austinlogistics.com
ezra at cpan.org
-------------------------------------------------------
The information in this Internet email is confidential and may be 
legally privileged. It is intended solely for the addressee. Access to 
this Internet email by anyone else is unauthorized. If you are not the 
intended recipient, any disclosure, copying, distribution or any action 
taken or any action omitted in reliance on it, is prohibited and may be 
unlawful. When addressed to our clients any opinions or advice contained

in this Internet email are subject to the terms and conditions expressed

in any applicable governing Austin Logistics' contract terms.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: Tom.Bakken at tx.usda.gov.vcf
Type: text/x-vcard
Size: 460 bytes
Desc: Tom.Bakken at tx.usda.gov.vcf
Url : http://mail.pm.org/pipermail/austin/attachments/20040923/67ed5516/Tom.Bakkentx.usda.gov.vcf


More information about the Austin mailing list