coreybutler / node-windows

Windows support for Node.JS scripts (daemons, eventlog, UAC, etc).
Other
2.78k stars 357 forks source link

define service dependencies #255

Closed rampd2 closed 4 years ago

rampd2 commented 4 years ago

I would like to define a service dependency (another "normal" windows service not a, with node-windows created, service) and I think winsw would support it, see here.

As I already described in this Stackoverflow question, for me it seems to be a issue in node-windows.

I also checked following issues already:

151 (this is just for node.js services?!)

29 (also node.js service)

Or else I would have to ignore the dependency (which might not be great) or modify the xml in the service creation progress.

rampd2 commented 4 years ago

I think I got it, it's implemented but not documented (at least I didn't found it): https://github.com/coreybutler/node-windows/blob/master/lib/winsw.js#L25 https://github.com/coreybutler/node-windows/blob/master/lib/winsw.js#L110

That brought me to the following code:

...
var svc = new Service({
  ...,
  dependencies: [
    'EventLog',
    'W32Time'
  ]
});
...