@kronos-integration/service-systemd 2.4.9 → 2.5.3
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 +32 -23
- package/package.json +14 -13
- package/src/service.mjs +27 -1
- package/systemd-linux-arm64.node +0 -0
- package/systemd-linux-arm.node +0 -0
- package/systemd-linux-x64.node +0 -0
package/README.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
[](https://bundlephobia.com/result?p=@kronos-integration/service-systemd)
|
|
4
4
|
[](https://npmjs.org/package/@kronos-integration/service-systemd)
|
|
5
5
|
[](https://github.com/Kronos-Integration/service-systemd/issues)
|
|
6
|
-
[](https://actions-badge.atrox.dev/Kronos-Integration/service-systemd/goto)
|
|
7
7
|
[](https://github.com/prettier/prettier)
|
|
8
8
|
[](http://commitizen.github.io/cz-cli/)
|
|
9
9
|
[](https://snyk.io/test/github/Kronos-Integration/service-systemd)
|
|
@@ -13,11 +13,11 @@
|
|
|
13
13
|
|
|
14
14
|
kronos systemd integration
|
|
15
15
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
16
|
+
* sync node state to systemd with notify (done)
|
|
17
|
+
* propagate config into kronos (done)
|
|
18
|
+
* propagate socket activations into kronos (partly)
|
|
19
|
+
* start / stop / restart / reload initiated from systemd (partly)
|
|
20
|
+
* log into journal (done)
|
|
21
21
|
|
|
22
22
|
# usage
|
|
23
23
|
|
|
@@ -27,14 +27,15 @@ kronos systemd integration
|
|
|
27
27
|
|
|
28
28
|
### Table of Contents
|
|
29
29
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
30
|
+
* [JournalLogger](#journallogger)
|
|
31
|
+
* [FileDescriptor](#filedescriptor)
|
|
32
|
+
* [Properties](#properties)
|
|
33
|
+
* [SystemdConfig](#systemdconfig)
|
|
34
|
+
* [Properties](#properties-1)
|
|
35
|
+
* [listeningFileDescriptors](#listeningfiledescriptors)
|
|
36
|
+
* [loadConfig](#loadconfig)
|
|
37
|
+
* [ServiceSystemd](#servicesystemd)
|
|
38
|
+
* [endpoints](#endpoints)
|
|
38
39
|
|
|
39
40
|
## JournalLogger
|
|
40
41
|
|
|
@@ -48,8 +49,8 @@ Type: [Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Globa
|
|
|
48
49
|
|
|
49
50
|
### Properties
|
|
50
51
|
|
|
51
|
-
|
|
52
|
-
|
|
52
|
+
* `name` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?**
|
|
53
|
+
* `fd` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)**
|
|
53
54
|
|
|
54
55
|
## SystemdConfig
|
|
55
56
|
|
|
@@ -60,13 +61,13 @@ Also injects listeningFileDescriptors into the config
|
|
|
60
61
|
|
|
61
62
|
### Properties
|
|
62
63
|
|
|
63
|
-
|
|
64
|
+
* `configurationDirectory` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** taken from CONFIGURATION_DIRECTORY
|
|
64
65
|
|
|
65
66
|
### listeningFileDescriptors
|
|
66
67
|
|
|
67
68
|
listeningFileDescriptors as passed in LISTEN_FDS and LISTEN_FDNAMES.
|
|
68
69
|
|
|
69
|
-
Returns **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)
|
|
70
|
+
Returns **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)<[FileDescriptor](#filedescriptor)>**
|
|
70
71
|
|
|
71
72
|
### loadConfig
|
|
72
73
|
|
|
@@ -79,11 +80,19 @@ Additionally pass listeninfFileDescriptions into config.
|
|
|
79
80
|
|
|
80
81
|
Kronos bridge to systemd:
|
|
81
82
|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
83
|
+
* sync node state to systemd with notify
|
|
84
|
+
* propagate config into kronos world
|
|
85
|
+
* propagate socket activations into kronos (partly)
|
|
86
|
+
* start / stop / restart / reload initiated from systemd
|
|
87
|
+
* log into journal
|
|
88
|
+
|
|
89
|
+
### endpoints
|
|
90
|
+
|
|
91
|
+
Definition of the predefined endpoints.
|
|
92
|
+
|
|
93
|
+
* info *in*
|
|
94
|
+
|
|
95
|
+
Returns **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** predefined endpoints
|
|
87
96
|
|
|
88
97
|
# install
|
|
89
98
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kronos-integration/service-systemd",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.5.3",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -24,28 +24,28 @@
|
|
|
24
24
|
"license": "BSD-2-Clause",
|
|
25
25
|
"scripts": {
|
|
26
26
|
"test": "npm run test:ava",
|
|
27
|
-
"test:ava": "ava --timeout 2m tests/*.mjs",
|
|
28
|
-
"cover": "c8 -x 'tests/**/*' --temp-directory build/tmp ava --timeout 2m tests/*.mjs && c8 report -r lcov -o build/coverage --temp-directory build/tmp",
|
|
29
|
-
"docs": "documentation readme
|
|
27
|
+
"test:ava": "ava -s --timeout 2m tests/*.mjs",
|
|
28
|
+
"cover": "c8 -x 'tests/**/*' --temp-directory build/tmp ava -s --timeout 2m tests/*.mjs && c8 report -r lcov -o build/coverage --temp-directory build/tmp",
|
|
29
|
+
"docs": "documentation readme --section=API ./src/**/*.mjs",
|
|
30
30
|
"lint": "npm run lint:docs",
|
|
31
|
-
"lint:docs": "documentation lint ./src
|
|
31
|
+
"lint:docs": "documentation lint ./src/**/*.mjs",
|
|
32
32
|
"build": "cmake-js compile"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@kronos-integration/service": "^10.
|
|
35
|
+
"@kronos-integration/service": "^10.4.11",
|
|
36
36
|
"config-expander": "^12.0.1"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
39
|
"ava": "^3.15.0",
|
|
40
|
-
"c8": "^7.
|
|
41
|
-
"cmake-js": "^6.1
|
|
42
|
-
"documentation": "
|
|
43
|
-
"execa": "^
|
|
44
|
-
"node-addon-api": "^
|
|
45
|
-
"semantic-release": "^
|
|
40
|
+
"c8": "^7.10.0",
|
|
41
|
+
"cmake-js": "^6.2.1",
|
|
42
|
+
"documentation": "^13.2.5",
|
|
43
|
+
"execa": "^6.0.0",
|
|
44
|
+
"node-addon-api": "^4.0.0",
|
|
45
|
+
"semantic-release": "^18.0.1"
|
|
46
46
|
},
|
|
47
47
|
"engines": {
|
|
48
|
-
"node": ">=
|
|
48
|
+
"node": ">=16.13.1"
|
|
49
49
|
},
|
|
50
50
|
"os": [
|
|
51
51
|
"linux"
|
|
@@ -62,6 +62,7 @@
|
|
|
62
62
|
"template": {
|
|
63
63
|
"inheritFrom": [
|
|
64
64
|
"arlac77/template-arlac77-github",
|
|
65
|
+
"arlac77/template-cmake",
|
|
65
66
|
"arlac77/template-kronos-component"
|
|
66
67
|
]
|
|
67
68
|
}
|
package/src/service.mjs
CHANGED
|
@@ -59,7 +59,7 @@ class SystemdConfig extends ServiceConfig {
|
|
|
59
59
|
static get description() {
|
|
60
60
|
return "Synchronize configuration with systemd";
|
|
61
61
|
}
|
|
62
|
-
|
|
62
|
+
|
|
63
63
|
configurationDirectory = process.env.CONFIGURATION_DIRECTORY;
|
|
64
64
|
|
|
65
65
|
/**
|
|
@@ -155,6 +155,21 @@ export class ServiceSystemd extends ServiceProviderMixin(
|
|
|
155
155
|
return true;
|
|
156
156
|
}
|
|
157
157
|
|
|
158
|
+
/**
|
|
159
|
+
* Definition of the predefined endpoints.
|
|
160
|
+
* - info _in_
|
|
161
|
+
* @return {Object} predefined endpoints
|
|
162
|
+
*/
|
|
163
|
+
static get endpoints() {
|
|
164
|
+
return {
|
|
165
|
+
...super.endpoints,
|
|
166
|
+
info: {
|
|
167
|
+
in: true,
|
|
168
|
+
receive: "details"
|
|
169
|
+
}
|
|
170
|
+
};
|
|
171
|
+
}
|
|
172
|
+
|
|
158
173
|
async _start() {
|
|
159
174
|
process.on("warning", warning => this.warn(warning));
|
|
160
175
|
process.on("SIGINT", () => {
|
|
@@ -182,6 +197,17 @@ export class ServiceSystemd extends ServiceProviderMixin(
|
|
|
182
197
|
break;
|
|
183
198
|
}
|
|
184
199
|
}
|
|
200
|
+
|
|
201
|
+
details()
|
|
202
|
+
{
|
|
203
|
+
return this.toJSONWithOptions({
|
|
204
|
+
includeRuntimeInfo: true,
|
|
205
|
+
includeDefaults: true,
|
|
206
|
+
includeName: true,
|
|
207
|
+
includeConfig: false,
|
|
208
|
+
includePrivate: false
|
|
209
|
+
});
|
|
210
|
+
}
|
|
185
211
|
}
|
|
186
212
|
|
|
187
213
|
export default ServiceSystemd;
|
package/systemd-linux-arm64.node
CHANGED
|
Binary file
|
package/systemd-linux-arm.node
DELETED
|
Binary file
|
package/systemd-linux-x64.node
DELETED
|
Binary file
|