PDA

View Full Version : VDF as a service



Ian Telfer
9-Feb-2005, 03:12 AM
Hi All,

I'm trying to run a small VDF app as a service on a Win2k Server, but it
will not start. I've removed all the status panels, toolbars & panel
object locations etc, and it will run as a standalone, but not as a service.

What components should be there and what should be removed to make it
work? This is Vdf10.1

Thanks

Ian

Hans van de Laar
9-Feb-2005, 06:06 AM
Ian,

Could this be a network rights problem? How do you run your VDF app as
a service? We have some VDF apps running under the (third party)
FireDeamon service software and these applications are using the local
administrator account to run properly.


--
Regards,

Hans van de Laar
Micros b.v.
www.micros.nl



Ian Telfer wrote:

> Hi All,
>
> I'm trying to run a small VDF app as a service on a Win2k Server, but
> it will not start. I've removed all the status panels, toolbars &
> panel object locations etc, and it will run as a standalone, but not
> as a service.
>
> What components should be there and what should be removed to make it
> work? This is Vdf10.1
>
> Thanks
>
> Ian

Knut Sparhell
9-Feb-2005, 09:40 AM
Ian Telfer wrote:

> I'm trying to run a small VDF app as a service on a Win2k Server, but it
> will not start. I've removed all the status panels, toolbars & panel
> object locations etc, and it will run as a standalone, but not as a
> service.
>
> What components should be there and what should be removed to make it
> work? This is Vdf10.1

There is no need to remove anything if you use a tool that will run your
application as a service under a helper process. No need to have any
views, for the matter.

I use FireDaemon, a free and excellent tool for one service, a small
license for more than one.

Remember to test your program under both a specific user count (not
LocalSystem) AND under LocalSystem (SYSTEM), but SYSTEM will not be able
to access network resources (test with local paths only). Running as
SYSTEM will also enable you to see any error messages on the screen
("interact with desktop" only works when SYSTEM), but a proper service
should not display any errors in a usual stop_box, in any case. Set the
error_object_id to self, and handle the errors. You may use Showln to
express them without any problem for a service.

You should also be careful with using network mapped drives. Use UNC
paths if any problem with those.

I also advise to use the Job Type GlobalJob. This is to ensure there
are no left over (orphan) VDFDaemon processes after a crash.

There are better tools to see such orphan processes than the Windows
Task manager. It's very important to avoid those!

At last, test that your service runs after you have logged out from your
account. This is the only problem with FireDaemon. In some, rare
occasions, the process dies too.

Also check if your process eats memory over time when very active. If
it does, schedule a restart now and then.

--
Knut Sparhell, Norway

Ian Telfer
9-Feb-2005, 06:35 PM
Hi Knut,

Thanks for the information, several things I had not considered.

I was trying to use the InstSvr.exe to make it run as a windows service.
I have loaded it, but it fails to start, and that's where I thought
that all GUI had to be removed from the program, only problem is that if
I do, then it comes up with errors on startup and fails.

There are a couple of excellent papers showing how to do it under vdf7,
but none since.

I can have it running as a small app that starts when the system
reboots, but as you say, the most important is that it runs when the
users account is logged off.

I've download Firedaemon, now that's the easy way to do it! I'll just
have to check what happens when the admin user loggs off, or not log off...

Cheers


Knut Sparhell wrote:
> Ian Telfer wrote:
>
>> I'm trying to run a small VDF app as a service on a Win2k Server, but
>> it will not start. I've removed all the status panels, toolbars &
>> panel object locations etc, and it will run as a standalone, but not
>> as a service.
>>
>> What components should be there and what should be removed to make it
>> work? This is Vdf10.1
>
>
> There is no need to remove anything if you use a tool that will run your
> application as a service under a helper process. No need to have any
> views, for the matter.
>
> I use FireDaemon, a free and excellent tool for one service, a small
> license for more than one.
>
> Remember to test your program under both a specific user count (not
> LocalSystem) AND under LocalSystem (SYSTEM), but SYSTEM will not be able
> to access network resources (test with local paths only). Running as
> SYSTEM will also enable you to see any error messages on the screen
> ("interact with desktop" only works when SYSTEM), but a proper service
> should not display any errors in a usual stop_box, in any case. Set the
> error_object_id to self, and handle the errors. You may use Showln to
> express them without any problem for a service.
>
> You should also be careful with using network mapped drives. Use UNC
> paths if any problem with those.
>
> I also advise to use the Job Type GlobalJob. This is to ensure there
> are no left over (orphan) VDFDaemon processes after a crash.
>
> There are better tools to see such orphan processes than the Windows
> Task manager. It's very important to avoid those!
>
> At last, test that your service runs after you have logged out from your
> account. This is the only problem with FireDaemon. In some, rare
> occasions, the process dies too.
>
> Also check if your process eats memory over time when very active. If
> it does, schedule a restart now and then.
>

Knut Sparhell
9-Feb-2005, 10:28 PM
Ian Telfer wrote:

> I can have it running as a small app that starts when the system
> reboots, but as you say, the most important is that it runs when the
> users account is logged off.

To ensure it starts correctly after reboot you must set up a suitable
dependency. I use ProtectedStorage and RPCSS (spell exactly). Don't
ask me why those are suitable, but they seem to be good enough. The
reason for having a dependecy set to system services is to ensure your
service is not started too early in the boot process, before the
necessary basic resources are up and running. Don't set dependecy to a
service that may be restarted while the server is running.

--
Knut Sparhell, Norway

Ian Telfer
9-Feb-2005, 11:45 PM
Knut Sparhell wrote:
> Ian Telfer wrote:
>
>> I can have it running as a small app that starts when the system
>> reboots, but as you say, the most important is that it runs when the
>> users account is logged off.
>
>
> To ensure it starts correctly after reboot you must set up a suitable
> dependency. I use ProtectedStorage and RPCSS (spell exactly). Don't
> ask me why those are suitable, but they seem to be good enough. The
> reason for having a dependecy set to system services is to ensure your
> service is not started too early in the boot process, before the
> necessary basic resources are up and running. Don't set dependecy to a
> service that may be restarted while the server is running.
>

Thanks very much Knut,

As usual your help is fantastic.

Ian