@kronos-integration/service-systemd 4.2.3 → 5.1.0

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/LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (C) 2019-2025 by arlac77
1
+ Copyright (C) 2019-2026 by arlac77
2
2
 
3
3
  Permission to use, copy, modify, and/or distribute this software for any
4
4
  purpose with or without fee is hereby granted.
package/README.md CHANGED
@@ -27,6 +27,8 @@ kronos systemd integration
27
27
  ### Table of Contents
28
28
 
29
29
  * [JournalLogger](#journallogger)
30
+ * [logEntry](#logentry)
31
+ * [Parameters](#parameters)
30
32
  * [FileDescriptor](#filedescriptor)
31
33
  * [Properties](#properties)
32
34
  * [credentialsDirectory](#credentialsdirectory)
@@ -35,12 +37,13 @@ kronos systemd integration
35
37
  * [listeningFileDescriptors](#listeningfiledescriptors)
36
38
  * [loadConfig](#loadconfig)
37
39
  * [ServiceSystemd](#servicesystemd)
38
- * [Parameters](#parameters)
40
+ * [Parameters](#parameters-1)
41
+ * [registerService](#registerservice)
42
+ * [Parameters](#parameters-2)
39
43
  * [getCredential](#getcredential)
40
- * [Parameters](#parameters-1)
44
+ * [Parameters](#parameters-3)
41
45
  * [getCredentials](#getcredentials)
42
- * [Parameters](#parameters-2)
43
- * [endpoints](#endpoints)
46
+ * [Parameters](#parameters-4)
44
47
 
45
48
  ## JournalLogger
46
49
 
@@ -48,6 +51,14 @@ kronos systemd integration
48
51
 
49
52
  Forward logs entries to the journal.
50
53
 
54
+ ### logEntry
55
+
56
+ Pass to systemd journal.
57
+
58
+ #### Parameters
59
+
60
+ * `entry` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** 
61
+
51
62
  ## FileDescriptor
52
63
 
53
64
  Type: [Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)
@@ -100,6 +111,14 @@ Kronos bridge to systemd:
100
111
  * `config` (optional, default `{}`)
101
112
  * `ic`  
102
113
 
114
+ ### registerService
115
+
116
+ When in debug mode; every sevice gets the logLevel of the service provider.
117
+
118
+ #### Parameters
119
+
120
+ * `service` **Service** 
121
+
103
122
  ### getCredential
104
123
 
105
124
  Deliver credential as provided by systemd.
@@ -122,14 +141,6 @@ Deliver credentials as provided by systemd.
122
141
 
123
142
  Returns **[Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)<[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)<([Uint8Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array) | [string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String))>>**&#x20;
124
143
 
125
- ### endpoints
126
-
127
- Definition of the predefined endpoints.
128
-
129
- * info *in*
130
-
131
- Returns **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** predefined endpoints
132
-
133
144
  # install
134
145
 
135
146
  With [npm](http://npmjs.org) do:
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "@kronos-integration/service-systemd",
3
- "version": "4.2.3",
3
+ "version": "5.1.0",
4
4
  "publishConfig": {
5
5
  "access": "public",
6
6
  "provenance": false
7
7
  },
8
- "packageManager": "npm@11.6.4+sha512.1118cab46a05a50aee6bff5b1b4fa1df18afff89d57465620a3518035026955db87c5bdf9d207b07b7487d99f2490d450cb774655ad63ec2cba7bf1d0ad25d45",
8
+ "packageManager": "npm@11.9.0+sha512.04166853ddba142ca98f86fb57b1258a7c6c59ccb82acb3cf141b77a315898acaaed47395e74f7e0c7b69c486008e68be6a6381ef1aee5a23dd82e0e61decd68",
9
9
  "exports": {
10
10
  ".": "./src/service.mjs"
11
11
  },
@@ -33,20 +33,20 @@
33
33
  "build": "cmake-js compile"
34
34
  },
35
35
  "dependencies": {
36
- "@kronos-integration/service": "^15.1.1",
36
+ "@kronos-integration/service": "^15.4.25",
37
37
  "config-expander": "^14.0.9"
38
38
  },
39
39
  "devDependencies": {
40
40
  "ava": "^6.4.1",
41
41
  "c8": "^10.1.3",
42
- "cmake-js": "^7.4.0",
42
+ "cmake-js": "^8.0.0",
43
43
  "documentation": "^14.0.3",
44
44
  "execa": "^9.6.1",
45
45
  "node-addon-api": "^8.5.0",
46
- "semantic-release": "^25.0.2"
46
+ "semantic-release": "^25.0.3"
47
47
  },
48
48
  "engines": {
49
- "node": ">=24.11.1"
49
+ "node": ">=24.13.0"
50
50
  },
51
51
  "os": [
52
52
  "linux"
package/src/service.mjs CHANGED
@@ -32,6 +32,10 @@ class JournalLogger extends ServiceLogger {
32
32
  return "Forward log entries into systemd journal";
33
33
  }
34
34
 
35
+ /**
36
+ * Pass to systemd journal.
37
+ * @param {Object} entry
38
+ */
35
39
  async logEntry(entry) {
36
40
  journal_print_object(entry);
37
41
  }
@@ -85,7 +89,7 @@ class SystemdConfig extends ServiceConfig {
85
89
 
86
90
  /**
87
91
  * Load config from configuration dir.
88
- * Additionally pass listeninfFileDescriptions into config.
92
+ * Additionally pass listeningFileDescriptions into config.
89
93
  */
90
94
  async loadConfig() {
91
95
  notify("RELOADING=1");
@@ -164,6 +168,11 @@ export class ServiceSystemd extends ServiceProviderMixin(
164
168
  super(config, ic);
165
169
  }
166
170
 
171
+ /**
172
+ * When in debug mode; every service gets the logLevel of the service provider.
173
+ * @param {Service} service
174
+ * @returns
175
+ */
167
176
  async registerService(service) {
168
177
  if(process.env.DEBUG) {
169
178
  service.logLevel = this.logLevel;
@@ -171,10 +180,6 @@ export class ServiceSystemd extends ServiceProviderMixin(
171
180
  return super.registerService(service);
172
181
  }
173
182
 
174
- get autostart() {
175
- return true;
176
- }
177
-
178
183
  /**
179
184
  * Deliver credential as provided by systemd.
180
185
  * @param {string} key
@@ -195,21 +200,6 @@ export class ServiceSystemd extends ServiceProviderMixin(
195
200
  return Promise.all(keys.map(key => this.getCredential(key, options)));
196
201
  }
197
202
 
198
- /**
199
- * Definition of the predefined endpoints.
200
- * - info _in_
201
- * @return {Object} predefined endpoints
202
- */
203
- static get endpoints() {
204
- return {
205
- ...super.endpoints,
206
- info: {
207
- in: true,
208
- receive: "details"
209
- }
210
- };
211
- }
212
-
213
203
  async _start() {
214
204
  process.on("warning", warning => this.warn(warning));
215
205
  process.on("SIGINT", () => {
@@ -238,14 +228,9 @@ export class ServiceSystemd extends ServiceProviderMixin(
238
228
  }
239
229
  }
240
230
 
241
- details() {
242
- return this.toJSONWithOptions({
243
- includeRuntimeInfo: true,
244
- includeDefaults: true,
245
- includeName: true,
246
- includeConfig: false,
247
- includePrivate: false
248
- });
231
+ propagateState(text)
232
+ {
233
+ notify("STATE=" + text);
249
234
  }
250
235
  }
251
236
 
Binary file
Binary file