@kronos-integration/service-systemd 4.2.3 → 5.0.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/README.md +23 -3
- package/package.json +3 -3
- package/src/service.mjs +9 -29
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,11 +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-
|
|
44
|
+
* [Parameters](#parameters-3)
|
|
41
45
|
* [getCredentials](#getcredentials)
|
|
42
|
-
* [Parameters](#parameters-
|
|
46
|
+
* [Parameters](#parameters-4)
|
|
43
47
|
* [endpoints](#endpoints)
|
|
44
48
|
|
|
45
49
|
## JournalLogger
|
|
@@ -48,6 +52,14 @@ kronos systemd integration
|
|
|
48
52
|
|
|
49
53
|
Forward logs entries to the journal.
|
|
50
54
|
|
|
55
|
+
### logEntry
|
|
56
|
+
|
|
57
|
+
Pass to systemd journal.
|
|
58
|
+
|
|
59
|
+
#### Parameters
|
|
60
|
+
|
|
61
|
+
* `entry` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** 
|
|
62
|
+
|
|
51
63
|
## FileDescriptor
|
|
52
64
|
|
|
53
65
|
Type: [Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)
|
|
@@ -100,6 +112,14 @@ Kronos bridge to systemd:
|
|
|
100
112
|
* `config` (optional, default `{}`)
|
|
101
113
|
* `ic`  
|
|
102
114
|
|
|
115
|
+
### registerService
|
|
116
|
+
|
|
117
|
+
When in debug mode; every sevice gets the logLevel of the service provider.
|
|
118
|
+
|
|
119
|
+
#### Parameters
|
|
120
|
+
|
|
121
|
+
* `service` **Service** 
|
|
122
|
+
|
|
103
123
|
### getCredential
|
|
104
124
|
|
|
105
125
|
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": "
|
|
3
|
+
"version": "5.0.0",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public",
|
|
6
6
|
"provenance": false
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"build": "cmake-js compile"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@kronos-integration/service": "^15.
|
|
36
|
+
"@kronos-integration/service": "^15.4.1",
|
|
37
37
|
"config-expander": "^14.0.9"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"semantic-release": "^25.0.2"
|
|
47
47
|
},
|
|
48
48
|
"engines": {
|
|
49
|
-
"node": ">=24.
|
|
49
|
+
"node": ">=24.12.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
|
}
|
|
@@ -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 sevice 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", () => {
|
|
@@ -237,16 +227,6 @@ export class ServiceSystemd extends ServiceProviderMixin(
|
|
|
237
227
|
break;
|
|
238
228
|
}
|
|
239
229
|
}
|
|
240
|
-
|
|
241
|
-
details() {
|
|
242
|
-
return this.toJSONWithOptions({
|
|
243
|
-
includeRuntimeInfo: true,
|
|
244
|
-
includeDefaults: true,
|
|
245
|
-
includeName: true,
|
|
246
|
-
includeConfig: false,
|
|
247
|
-
includePrivate: false
|
|
248
|
-
});
|
|
249
|
-
}
|
|
250
230
|
}
|
|
251
231
|
|
|
252
232
|
export default ServiceSystemd;
|