#1 2019-05-04 16:06:23

camu72
Member
From: Salta - Argentina
Registered: 2015-07-12
Posts: 28

Defining ServiceDependences in TServiceController.CheckParameters

Hi ab, could be posible add a Dependences parameter to CheckParameters in mORMotService unit?

// In Definition change this
class procedure CheckParameters(const ExeFileName: TFileName;
      const ServiceName,DisplayName,Description: string); 

// for this
class procedure CheckParameters(const ExeFileName: TFileName;
      const ServiceName,DisplayName,Description,Dependencies: string);

//and In the implementation add de dependences to :TServiceController.Install
    ... 
    if param='/install' then
     TServiceController.Install(
       ServiceName,DisplayName,Description,true,ExeFileName,Dependencies) else
    ...

If is not posible, how can define dependence of service using CheckParameters?

Last edited by camu72 (2019-05-04 16:23:01)

Offline

#2 2019-05-07 21:33:44

Kixemi
Member
Registered: 2017-02-10
Posts: 10

Re: Defining ServiceDependences in TServiceController.CheckParameters

I was also looking for this functionality in TServiceController!
MSSQL has to be started before the rest server starts,
So by now I don't see how I could easyly install the Windows service with the TServiceController!

Best regards Kim Granlund

Offline

#3 2019-05-07 22:01:38

mpv
Member
From: Ukraine
Registered: 2012-03-24
Posts: 1,571
Website

Re: Defining ServiceDependences in TServiceController.CheckParameters

I use NSSM for a long time as replacement for the "strange" windows service API. It's allow for almost any console app what correctly handle console events to be executed as a service easy (with a dependencies, restarting and so on). Very cool tool IMHO

Offline

#4 2019-05-08 13:27:05

camu72
Member
From: Salta - Argentina
Registered: 2015-07-12
Posts: 28

Re: Defining ServiceDependences in TServiceController.CheckParameters

Hi Kixemi, I modified the source of MormotService unit like in a first post, and runs OK, puting in Depenedencies parametrer, the name of Firebird Service in my case. The problems will came when Pull or Fetch the mORMot library... i will lose that changes.... but outside of that, works.

Offline

#5 2019-05-08 14:42:20

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,659
Website

Re: Defining ServiceDependences in TServiceController.CheckParameters

I have added an optional Dependencies information to TServiceController.CheckParameters, but also to TDDDDaemon and TSynDaemon.

See https://synopse.info/fossil/info/faf7456dc7

Offline

#6 2019-05-08 20:41:47

camu72
Member
From: Salta - Argentina
Registered: 2015-07-12
Posts: 28

Re: Defining ServiceDependences in TServiceController.CheckParameters

Thanks ab... you really work fast!!!

Offline

Board footer

Powered by FluxBB