@kronos-integration/service-systemd 4.1.0 → 4.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -33,10 +33,11 @@ kronos systemd integration
33
33
  * [listeningFileDescriptors](#listeningfiledescriptors)
34
34
  * [loadConfig](#loadconfig)
35
35
  * [ServiceSystemd](#servicesystemd)
36
+ * [Parameters](#parameters)
36
37
  * [getCredential](#getcredential)
37
- * [Parameters](#parameters)
38
- * [getCredentials](#getcredentials)
39
38
  * [Parameters](#parameters-1)
39
+ * [getCredentials](#getcredentials)
40
+ * [Parameters](#parameters-2)
40
41
  * [endpoints](#endpoints)
41
42
 
42
43
  ## JournalLogger
@@ -92,6 +93,11 @@ Kronos bridge to systemd:
92
93
  * start / stop / restart / reload initiated from systemd
93
94
  * log into journal
94
95
 
96
+ ### Parameters
97
+
98
+ * `config` (optional, default `{}`)
99
+ * `ic`  
100
+
95
101
  ### getCredential
96
102
 
97
103
  Deliver credential as provided by systemd.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kronos-integration/service-systemd",
3
- "version": "4.1.0",
3
+ "version": "4.2.1",
4
4
  "publishConfig": {
5
5
  "access": "public",
6
6
  "provenance": false
@@ -32,7 +32,7 @@
32
32
  "build": "cmake-js compile"
33
33
  },
34
34
  "dependencies": {
35
- "@kronos-integration/service": "^15.0.0",
35
+ "@kronos-integration/service": "^15.0.1",
36
36
  "config-expander": "^14.0.9"
37
37
  },
38
38
  "devDependencies": {
package/src/service.mjs CHANGED
@@ -67,8 +67,9 @@ class SystemdConfig extends ServiceConfig {
67
67
  * @return {FileDescriptor[]}
68
68
  */
69
69
  get listeningFileDescriptors() {
70
- const count = Number(process.env.LISTEN_FDS) ?? 0;
70
+ const count = process.env.LISTEN_FDS ? parseInt(process.env.LISTEN_FDS) : 0;
71
71
  const fdNames = (process.env.LISTEN_FDNAMES || "").split(":");
72
+
72
73
  const arr = new Array(count);
73
74
  for (let i = 0; i < count; i++) {
74
75
  arr[i] = {
@@ -154,7 +155,7 @@ export class ServiceSystemd extends ServiceProviderMixin(
154
155
  return "Bridge to systemd";
155
156
  }
156
157
 
157
- constructor(config, ic) {
158
+ constructor(config={}, ic) {
158
159
  if (process.env.LOGLEVEL) {
159
160
  config.logLevel = process.env.LOGLEVEL;
160
161
  } else if (process.env.DEBUG) {
@@ -163,6 +164,13 @@ export class ServiceSystemd extends ServiceProviderMixin(
163
164
  super(config, ic);
164
165
  }
165
166
 
167
+ async registerService(service) {
168
+ if(process.env.DEBUG) {
169
+ service.logLevel = this.logLevel;
170
+ }
171
+ return super.registerService(service);
172
+ }
173
+
166
174
  get autostart() {
167
175
  return true;
168
176
  }