Page 1 of 1 1
Topic Options
#23649 - 2002-06-20 10:00 PM 5 kix32 processes remain on Windows NT 4.0 server. kix32 tasks can't be terminated.
tarus Offline
Fresh Scripter

Registered: 2002-06-14
Posts: 12
I have five kix32.exe processes that remain on a Windows NT 4.0 Server stand-alone server. They each take up 3276 or 3280 KB RAM and I cannot "End Process" them because it gives me an "access denied" error message if I try.

I ran the same KiX script (5K in size) about 30 times within a few minutes and then noticed five processes remained about 30 minutes later. My KiX script does not have "exit 0" at the end and the script finishes within one second.

After I saw those processes remained, I tried to run my script again and the process did not remain. I even tried running my script many times very quickly without "success" of a remaining kix32 process.

I do not know what caused this to happen, and I would like any ideas of how it _could_ have happened, or if this has happened to anyone before.

(MCA: complete subject)

[ 21 June 2002, 00:19: Message edited by: MCA ]

Top
#23650 - 2002-06-20 10:11 PM Re: 5 kix32 processes remain on Windows NT 4.0 server. kix32 tasks can't be terminated.
BrianTX Offline
Korg Regular

Registered: 2002-04-01
Posts: 895
It has to do more with what's in the script and what permissions it was run under and if it's waiting for something before it can exit.

Brian

Top
#23651 - 2002-06-20 10:43 PM Re: 5 kix32 processes remain on Windows NT 4.0 server. kix32 tasks can't be terminated.
tarus Offline
Fresh Scripter

Registered: 2002-06-14
Posts: 12
It is strange that I cannot "End Process" them though. Thanks for the response. I'll see if it happens again.
Top
#23652 - 2002-06-21 12:15 AM Re: 5 kix32 processes remain on Windows NT 4.0 server. kix32 tasks can't be terminated.
MCA Offline
KiX Supporter
*****

Registered: 2000-04-28
Posts: 5152
Loc: Netherlands, EU
Dear,

What kind of things this script is doing? f.e. cleanup your harddisk from temporary files.
What kind of external programs you are call by SHELL or RUN command.
greetings.

btw: can you put your small script of 5K on the board.

[ 21 June 2002, 00:20: Message edited by: MCA ]
_________________________
email scripting@wanadoo.nl homepage scripting@wanadoo.nl | Links | Summary of Site Site KiXforms FAQ kixtart.org library collection mirror MCA | FAQ & UDF help file UDF kixtart.org library collection mirror MCA | mirror USA | mirror europe UDF scriptlogic library collection UDFs | mirror MCA

Top
#23653 - 2002-06-21 01:10 AM Re: 5 kix32 processes remain on Windows NT 4.0 server. kix32 tasks can't be terminated.
tarus Offline
Fresh Scripter

Registered: 2002-06-14
Posts: 12
I'm at home right now so I can't post my script yet. When I get back to work I will post it in the morning (approx. 16 hours from now). It isn't very commented, so I'll throw some in there before I post.

Right now I can tell you that it:

-Tries to open (using redirect) an output file on a network share (the name is " <@WKSTA>"), and if that succeeds, it collects the values Class and DeviceDesc each third-layer key in HKLM\Enum such as HKLM\Enum\MONITOR\DEFAULT_MONITOR\0001. It then prints that information to the output file on the network share.

-Tries to make a directory in the network share named @WKSTA. Tries to open another output file (the name is " ") in this @WKSTA directory, and if that succeeds, it sees if VirusScan, ePolicy Orchestrator Agent, NetShield NT,Word, Excel, PowerPoint, Outlook, Access, MS Project, and Visio are installed (looks in registry for this). Gets version of each (getfileversion) of these programs if they exist, gets dat version of VirusScan (registry), and gets engine version of VirusScan (registry). Prints this data along with @WKSTA, @USERID, @TICKS, @IPADDRESS0, @ADDRESS, @DOMAIN, @TIME, @DATE, to this output file.

If the script is called for within the same second, then the script uses the same filename (since it's unique only by @WKSTA, @DATE, and @TIME macros). This data just gets appended to it, which isn't a big deal I don't think.

Top
#23654 - 2002-06-21 08:03 AM Re: 5 kix32 processes remain on Windows NT 4.0 server. kix32 tasks can't be terminated.
MCA Offline
KiX Supporter
*****

Registered: 2000-04-28
Posts: 5152
Loc: Netherlands, EU
Dear,

It is possible that too much RedirectOutput function calls on the same file can bring
those processes in a limbo state. Possible that the filemanager of windows get in this limbo
state, which limbo state can't terminate by your taskmanager.
Possible when we see your script we can add proper debugging code to it with which you can
exatcly see in which state your script calls hangs.
Normally we are using
- WriteProfileString
- Open/WriteLine/Close
as file handling function.
greetins.

btw: by extremly file operations it is possible that the system clock of your computer can
keep the right time. After one working day we discover sometimes 10-30 minutes time differences.
It is only possible that some priorities of your windows version gets a higher priority as your
system clock. Possible that someone else recognize this problem too.
_________________________
email scripting@wanadoo.nl homepage scripting@wanadoo.nl | Links | Summary of Site Site KiXforms FAQ kixtart.org library collection mirror MCA | FAQ & UDF help file UDF kixtart.org library collection mirror MCA | mirror USA | mirror europe UDF scriptlogic library collection UDFs | mirror MCA

Top
#23655 - 2002-06-21 06:39 PM Re: 5 kix32 processes remain on Windows NT 4.0 server. kix32 tasks can't be terminated.
tarus Offline
Fresh Scripter

Registered: 2002-06-14
Posts: 12
I think I'm going to use the WriteLine command instead from now on.

Never posted code before, so here it goes:

code:
SetConsole("HIDE")

$time = @TIME
$date = @DATE
$new_time = trim(substr($time, 1, 2)) + trim(substr($time, 4, 2)) + trim(substr($time, 7, 2))
$new_date = trim(substr($date, 1, 4)) + trim(substr($date, 6, 2)) + trim(substr($date, 9, 2))

$sysinfo_file_location = "\\helios\test\testO\SysInfo\$new_date $new_time @WKSTA"
$comp_info_directory_location = "\\helios\test\testO\compinfo"
$comp_info_file_location = "\\helios\test\testO\compinfo\@WKSTA\$new_date $new_time"


$index=0
$enumsubkeys=""
$enumsubsubkeys=""
$enumsubsubsubkeys=""
$class=""
$devicedesc=""

; #### Part A #### This part reads HKLM\Enum for device names and writes them to $sysinfo_file_location
if (substr(@producttype,1,10) <> "Windows NT")
if (RedirectOutput($sysinfo_file_location) = "0")
:loop1
$enumsubkeys=enumkey("HKEY_LOCAL_MACHINE\Enum", $index)
if @error=0
$index2=0
:loop2
$enumsubsubkeys=enumkey("HKEY_LOCAL_MACHINE\Enum\$enumsubkeys", $index2)
if (@error=0 and $index2<30)
$index3=0
:loop3
$enumsubsubsubkeys=enumkey("HKEY_LOCAL_MACHINE\Enum\$enumsubkeys\$enumsubsubkeys", $index3)
$class=readvalue("HKEY_LOCAL_MACHINE\Enum\$enumsubkeys\$enumsubsubkeys\$enumsubsubsubkeys","Class")
$devicedesc=readvalue("HKEY_LOCAL_MACHINE\Enum\$enumsubkeys\$enumsubsubkeys\$enumsubsubsubkeys","DeviceDesc")
if (@error=0 and $index3<30)
if $class <> "system"
? $class + "," + $devicedesc
endif
$index3=$index3+1
goto loop3
endif
$index2=$index2+1
goto loop2
endif
$index=$index+1
goto loop1
endif
endif
endif
; #### Part A End ####


md "$comp_info_directory_location\@WKSTA" ; ## just in case the directory doesn't exist
if (RedirectOutput($comp_info_file_location) = "0")
dim $index, $freec, $freed, $os_type, $os_SP, $os_suite, $uptime, $HKLMAppPaths, $app, $path, $vscan, $vscan_dat, $vscan_engine, $epoagent, $netshieldnt, $winword, $excel, $powerpnt, $msaccess, $outlook, $mspub, $winproj, $visio32

; ####### Get MS Office version information #######
$excel = "none"
$winword = "none"
$powerpnt = "none"
$msaccess = "none"
$outlook = "none"
$mspub = "none"
$winproj = "none"
$visio32 = "none"

$HKLMAppPaths = "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths"
$index=0
while @error = 0
$app = enumkey("$HKLMAppPaths",$index)
$index = $index + 1
select
case $app = "winword.exe"
$path = readvalue("$HKLMAppPaths\$app","path")
$winword = getfileversion("$path\$app","Productversion")
case $app = "excel.exe"
$path = readvalue("$HKLMAppPaths\$app","path")
$excel = getfileversion("$path\$app","Productversion")
case $app = "powerpnt.exe"
$path = readvalue("$HKLMAppPaths\$app","path")
$powerpnt = getfileversion("$path\$app","Productversion")
case $app = "msaccess.exe"
$path = readvalue("$HKLMAppPaths\$app","path")
$msaccess = getfileversion("$path\$app","Productversion")
case $app = "outlook.exe"
$path = readvalue("$HKLMAppPaths\$app","path")
$outlook = getfileversion("$path\$app","Productversion")
case $app = "mspub.exe"
$path = readvalue("$HKLMAppPaths\$app","path")
$mspub = getfileversion("$path\$app","Productversion")
case $app = "winproj.exe"
$path = readvalue("$HKLMAppPaths\$app","path")
$winproj = getfileversion("$path\$app","Productversion")
case $app = "visio32.exe"
$path = readvalue("$HKLMAppPaths\$app","path")
$visio32 = getfileversion("$path\$app","Productversion")
endselect
loop
; ####### MS Office Version Info taken #######

; ####### Anti-Virus Info #######
$path = ReadValue("HKEY_LOCAL_MACHINE\Software\Network Associates\TVD\VirusScan","szInstallDir")
if ($path <> "")
$vscan = getfileversion("$path\vshwin32.exe")
endif
$vscan_dat = ReadValue("HKEY_LOCAL_MACHINE\Software\Network Associates\TVD\Shared Components\VirusScan Engine\4.0.xx","szDatVersion")
$vscan_engine = ReadValue("HKEY_LOCAL_MACHINE\Software\Network Associates\TVD\Shared Components\VirusScan Engine\4.0.xx","szEngineVer")

$path = ReadValue("HKEY_LOCAL_MACHINE\Software\Network Associates\ePolicy Orchestrator\Agent","Installed Path")
if ($path <> "")
$epoagent = getfileversion("$path\naimag32.exe")
endif

$path = ReadValue("HKEY_LOCAL_MACHINE\SOFTWARE\Network Associates\TVD\NetShield NT\CurrentVersion","szInstallDir")
if ($path <> "")
$netshieldnt = getfileversion("$path\shstat.exe")
endif

; ####### Anti-Virus Info taken #######

; ####### Operating System and SP Info #######
$os_type = @producttype
$os_SP = @CSD
$os_suite = @productsuite
; ####### Done with Operating System and SP info #######

; ####### Get Free Spaces of C:\ D:\ and E:\ ####
$freec = GetDiskSpace("C:\") / 1024
$freed = GetDiskSpace("D:\") / 1024
; ####### Free Spaces of C:\ D:\ and E:\ done ####

$old_ipaddr = @IPADDRESS0
$new_ipaddr = (LTRIM(SUBSTR($old_ipaddr,1,3))) + "." + (LTRIM(SUBSTR($old_ipaddr,5,3))) + "." + (LTRIM(SUBSTR($old_ipaddr,9,3))) + "." + (LTRIM(SUBSTR($old_ipaddr,13,3)))
$uptime = @TICKS/60000

? "@WKSTA,$new_ipaddr,@ADDRESS,@DOMAIN,@DATE,@TIME,@USERID,$freec,$freed,$os_type,$os_SP,$os_suite,$uptime,$vscan,$vscan_dat,$vscan_engine,$epoagent,$netshieldnt,$excel,$winword,$powerpnt,$msaccess,$outlook,$mspub,$winproj,$visio32"
endif

exit 0


Top
#23656 - 2002-06-22 12:10 AM Re: 5 kix32 processes remain on Windows NT 4.0 server. kix32 tasks can't be terminated.
MCA Offline
KiX Supporter
*****

Registered: 2000-04-28
Posts: 5152
Loc: Netherlands, EU
Dear,

A real problem can be there with the RedirectOutput operation.
Running same script again and again in a very short time may create a
deadlock situation and return those script in a limbo state. A state
which is mostly controlled at that point by the kernel of windows.
During both RedirectOutput operations you doesn't have collect all
wanted information at that point, which will increase the amount of
time those files are open for the real action.

We extend your code
code:
 $sysinfo_file_location = "\\helios\test\testO\SysInfo\$new_date $new_time @WKSTA"
$comp_info_directory_location = "\\helios\test\testO\compinfo"
$comp_info_file_location = "\\helios\test\testO\compinfo\@WKSTA\$new_date $new_time"

with @msecs
code:
 $sysinfo_file_location = "\\helios\test\testO\SysInfo\$new_date $new_time @WKSTA.@msecs"
$comp_info_directory_location = "\\helios\test\testO\compinfo"
$comp_info_file_location = "\\helios\test\testO\compinfo\@WKSTA\$new_date $new_time.@msecs"

Also we advice to use Open/WriteLine/Close or WriteProfileString as functions
for writting information to a file.

greetings.
_________________________
email scripting@wanadoo.nl homepage scripting@wanadoo.nl | Links | Summary of Site Site KiXforms FAQ kixtart.org library collection mirror MCA | FAQ & UDF help file UDF kixtart.org library collection mirror MCA | mirror USA | mirror europe UDF scriptlogic library collection UDFs | mirror MCA

Top
#23657 - 2002-06-22 07:06 PM Re: 5 kix32 processes remain on Windows NT 4.0 server. kix32 tasks can't be terminated.
tarus Offline
Fresh Scripter

Registered: 2002-06-14
Posts: 12
Thanks for the help and the welcome, MCA. I have learned how to use Open/WriteLine/Close so I will advance to that. I also did not know about the @msecs macro and I was thinking about adding a random number to the filename, so I will take your advice.
Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 2220 anonymous users online.
Newest Members
Viginette, ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder
17888 Registered Users

Generated in 0.145 seconds in which 0.11 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org