Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Rename Service Name
#1
Hi,

I knew, there was an old discussion about this. 

On a server farm I want to install several intraWeb server (for load balancing). The app should running as a service on each server as

Node.1 - using port 81
Node.2 - using port 82


Each has it own folder and should have the service name node.1, node.2 The config should be read out a ini file.

Running as stand alone work nice but as a service seemed to complicated.

in IWServerControllerBaseConfig i try

AppName := inifile('main', 'nodename', 'node');

but nothing happen. Appname /install - nothing happens (exception?). If I remove the line I can install the service

What would be the right way to install as service with different service name?

Thanks
Sven
Greetings
Sven
Reply
#2
Ok. node.1 is not a good name. but renaming it to node1 does not help. The service installer code uses the compiled name from AppName
Greetings
Sven
Reply
#3
HI Sven, how is it going?

I have to check but I think that the service name during installation is not affected by the ServerController.OnConfig event.

I mean the installation happens way before the ServerController is created and have a chance to set the ServiceName.

I'll check that and let you know.
Reply
#4
>I have to check but I think that the service name during installation is not affected by the ServerController.OnConfig event.

Yes. nothing happens here.

I think an OnServiceInstall / onServiceResume ... would be very helpful to control the installation/processes as a service. The TService-Objekt already have these events.

In the past I used the FireDaemon but this means always runningn an IntraWeb-GUI. For production environments semiprofessionel. It would be very helpful to install severel services without renaming the project Smile At least we need 6 running services on three servers to be on the safe side.

To clarify. Your are right: The ServerController.onConfig will be called but after the installation code of the service
Greetings
Sven
Reply
#5
Actually I was wrong :-)

OnConfig event fires first and then the Service code responsible for the installation of the service runs later.

You can configure both the ServerController.AppName (this will be the Service Name), ServerController.DisplayName (the service display name) and the ServiceController.Description (the service description) during the OnConfig event and it should be honored while installing the service.

Cheers,
Reply
#6
BTW, if your executable is named YourApplication.exe and you have an

YourApplication.ini

file in the same directory, the ServerController will load all properties from it automatically, as long as ServerController.AutoLoadIniSettings = True and the property exists. The format for it would be:

[ServerController]
AppName=MyApp
Description=My IntraWeb Application
DisplayName=IntraWeb Application
Reply
#7
Thank you for clarify. i will try it again.
Greetings
Sven
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)