2

A consultant setup a windows service to run a application. The application is supposed to run every 15 minutes. The application is not running at all and the service appears to be running fine.

I am not familiar with how an application will run at a standard interval when running as a service.

The service uses the SRVANY.EXE tool.

4

4 回答 4

6

任何设置服务以使用 SRVANY.EXE 运行的“顾问”都应该被解雇。SRVANY 是一个不幸的 hack,应该在十年前就被淘汰了。它不应该在生产环境中使用

如果该服务的唯一目的是按计划运行应用程序,那么它根本不应该存在。将应用程序作为计划任务运行。如果它具有其他功能,则将其重写为真正的服务。如果它写得相当好,它应该是一个相当容易的转换。

于 2009-02-24T15:00:37.003 回答
2

There are many potential issues with your application.

SRVANY.EXE turns any application into a Windows Service. If that application ever asks for user input, it will hang. You will want to confirm that the application running as a service does nothing more than start the other application.

You should also be able to run the "starter" application manually, outside the Windows Service. If it still doesn't work as it should you know it's not related to being run as a service.

于 2009-02-24T14:47:46.270 回答
1

要添加到其他答案:请参阅KB137890,了解 SRVANY.EXE 的实际作用以及如何找出它正在运行的应用程序。

在我看来,如果可以的话,您最好(如果可以的话)设置一个计划任务,该任务每 15 分钟运行一次每个应用程序。

于 2009-02-24T14:58:23.860 回答
0

I'm not sure if this is correct, but I believe one way of a serivce running an application is merely to have a thread within OnStart and set it to run the application on an invertal of 15 minutes.

于 2009-02-24T14:47:39.360 回答