• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

2k services question...

Entity

Lifer
Is there any way to automatically reboot a service every X minutes? I'm running VNC right now on a few boxes at our lab, and figured out a registry key which will keep the VNC icon hidden, so our users won't mess with it. However, that particular key isn't supported (I actually found it in a different, non-TightVNC version of the software and gave it a shot), and it causes the VNC server to crash periodically. Right now, I need to get into the systems via Computer Management and restart the service - but Win2k isn't reporting the service as dying, so it won't restart it automatically.

Anyone know a better way to do what I'm trying to do? Basically, I'm trying to hide TightVNC so that our users don't mess with it (it leaves an icon in the lower-right corner of the screen), but if I hide it, it dies every now and then, and I need to restart the service.

Confusing, eh? 🙂

Rob
 
You could write a batch (.cmd) file that contains the following:

@echo off
net stop <service>
net start <service>

Then create a scheduled task to run the .cmd file every X minutes.
 
Before I make any suggestions let me get one part clear. Win2k is not reporting the service as in the stopped state?

If it does report it as stopped you can write a VBScript file that will detect if the service is not running and then start it, or if it is running then it will do nothing. I would do what the first poster suggested because what if you are VNCed into the machine and then it stops the service on you?
 
why restart it automatically, you could just restart it if you need to remotely (or start it when you need to).

You could run a couple of simple commands on your box (with sc.exe out of the resource kit):
sc host stop vncservice
sc host start vncservice

Or you could use a combination of this and/or what mrchad suggested and this way you would only need a single script running that stops/starts all of them rather than having the script running everywhere

-Spy
 
Thanks for the recommendation on sc. Is that dependent on remote registry service running on the machine?

The service doesn't show up as stopped, so I have to restart it manually; it is broken, but doesn't send anything to the event logs or anything like that, so the system doesn't see it as being stopped. 😛

Rob
 
You could go into services.msc, go to the properties of that service, and tell the OS to automatically restart the service when it fails.

That's easier than writing a script, no?
 
yes but he said that the service wasnt failing, it was hanging so you couldnt set it to automatically restart. correct me if I'm wrong about this Entitiy.

-Spy
 
Originally posted by: spyordie007
yes but he said that the service wasnt failing, it was hanging so you couldnt set it to automatically restart. correct me if I'm wrong about this Entitiy.

-Spy

Well, a service hung in either the starting or stopping state can't be restared via net start, either. The SCM will wait for the service to finish starting or stopping before doing anything else with it.
 
Entity may have to clarify this but I get the impression that the service runs and than stops responding even though the OS reports the service as running. He is able to get it to respond if he restarts it but since the system doesnt show it as hung or stopped it cannot automatically restart it.

Does this sound right Entity?

-Spy
 
Originally posted by: spyordie007
Entity may have to clarify this but I get the impression that the service runs and than stops responding even though the OS reports the service as running. He is able to get it to respond if he restarts it but since the system doesnt show it as hung or stopped it cannot automatically restart it.

Does this sound right Entity?

-Spy

Yup, that was right, and I'm just using sc manually right now. 😀

Rob
 
Back
Top