Jump to content
The Uniform Server Community
10basetom

unidelay.exe process cannot be killed

Recommended Posts

I noticed that about a minute after I kill the unidelay.exe process, it restarts itself. Does anyone know what's restarting it, and how I can permanently kill unidelay.exe?

 

Thanks,

Tom

Share this post


Link to post
Share on other sites

Well what a pesky little critter, I assume a hydraulic press fails!

OK! Me jokes are not funny. :D

 

Unidelay is self-terminating, it either runs for one second or the number of seconds corresponding to a parameter passed to it.

 

Are you using this in a different application or just from UniServer?

 

The only reason it will reappear if it’s being called again. Hence if only run from UniServer then it looks like a safety loop timer failing and a bug. :(

 

A little more detail would be appreciated, server version and why you are manually killing the Unidelay process, do the servers run if not is this the issue.

 

After switching your PC off does the little critter come back when PC restarted? :)

 

All the best

Ric :)

Share this post


Link to post
Share on other sites

Hi Ric,

 

Good one :).

 

I'm running unidelay.exe from the run_cron.bat as given by the instructions here:

 

http://wiki.uniformserver.com/index.php/In...n_4.0-Mona#Cron

 

Here is my run_cron.bat file:

 

:next
udrive\home\admin\program\unidelay.exe 3600
udrive\usr\local\php\php.exe -n udrive\www\drupal\run_cron.php
goto :next
exit

I'm not running unidelay.exe from anywhere else. I noticed that after I stop Uniserver with Stop.bat, the unidelay.exe process is still kicking it, so I went to manually kill it, but it rises from the dead again after about a minute (even though I set my delay to 3600 seconds). In fact, I only noticed this after I added instructions to "pv.exe -k -f unidelay.exe" in Stop.bat. I'm pulling my hair trying to determine what the heck is restarting it because I'm looking at my process list and there's no process related to Uniserver that's running after you run Stop.bat (cmd.exe is also not running). Yeah, unidelay is gone for good after a reboot.

 

Are you able to reproduce this? Try recreating the batch from above and runnining it. I'm using the latest Uniserver: 4.3.

 

Tom *pulling his hair out*

Share this post


Link to post
Share on other sites

Yep! A pesky little critter, it’s a chicken and egg situation.

 

Killing unidelay.exe returns back to the batch file and instantly jumps to “:next” which starts unidelay again. Its independent of how you kill unidelay manually, using pv.exe or UniServer’s pskill. This loop needs to be broken try the following solution:

 

Modify run_cron.bat

rem ## create a temp file with value run
(set /p dummy=run) >temp.txt <nul

rem ##cron loop
:next
udrive\home\admin\program\unidelay.exe 3600
udrive\usr\local\php\php.exe -n udrive\www\drupal\run_cron.php

rem ## read file value
SET /P stop=<temp.txt

rem ## repeat cron loop if set to run
if %stop%==run goto :next

rem ## not set to “run” clean-up and exit
del temp.txt
exit

Create a new batch file stop_cron.bat add the following lines:

rem ## update temp file to stop
(set /p dummy=stop) >temp.txt <nul

rem ## kill off cron
udrive\home\admin\program\pskill.exe unidelay.exe c

exit

File temp.txt is used to break the loop. After killing unidelay the file content is checked if a value other than run is found it breaks the loop.

 

The two lines in stop_cron.bat can be placed in server stop bat.

 

All the best

Ric :)

Share this post


Link to post
Share on other sites

Hi Ric,

 

Your solution works like a charm -- very clever. Upon further inspection I was wrong: there WAS a cmd.exe process running that was reponsible for the infinite loop, so if you kill both cmd.exe and unidelay.exe then unidelay.exe is gone for good. However, I sometimes run several cmd.exe windows and don't want to accidently kill one of them, so your solution is safer :).

 

Now did you want to update the cron installation instructions in the wiki? If not, I can do it on your behalf.

 

Tom

 

P.S. I noticed that the current instructions to run run_cron.bat just below :END was causing unidelay.exe to run every time, even when Server_Start.bat errors out (e.g., servers already running), so I'm going to move run_cron.bat just below :NOTFOUND, right before the virtual drive logic:

 

:NOTFOUND
echo.
echo  Starting Drupal cron ...............
echo.
start udrive\home\admin\program\uniserv.exe run_cron.bat

 

Tom

Share this post


Link to post
Share on other sites

Hi Tom

Feel free to update the Wiki most appreciated because I am bound to forget to do it.

Thanks

Ric :)

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...