@kronos-integration/service-systemd
Version:
kronos systemd integration
136 lines (85 loc) • 5.42 kB
Markdown
[](https://spdx.org/licenses/0BSD.html)
[](https://github.com/Kronos-Integration/service-systemd/issues)
[](https://actions-badge.atrox.dev/Kronos-Integration/service-systemd/goto)
[](https://github.com/prettier/prettier)
[](http://commitizen.github.io/cz-cli/)
[](https://snyk.io/test/github/Kronos-Integration/service-systemd)
[](https://coveralls.io/github/Kronos-Integration/service-systemd)
# @kronos-integration/service-systemd
kronos systemd integration
* sync node state to systemd with notify (done)
* propagate config into kronos (done)
* propagate socket activations into kronos (partly)
* start / stop / restart / reload initiated from systemd (partly)
* log into journal (done)
# usage
# API
<!-- Generated by documentation.js. Update this documentation by updating the source code. -->
### Table of Contents
* [JournalLogger](#journallogger)
* [FileDescriptor](#filedescriptor)
* [Properties](#properties)
* [credentialsDirectory](#credentialsdirectory)
* [SystemdConfig](#systemdconfig)
* [Properties](#properties-1)
* [listeningFileDescriptors](#listeningfiledescriptors)
* [loadConfig](#loadconfig)
* [ServiceSystemd](#servicesystemd)
* [getCredential](#getcredential)
* [Parameters](#parameters)
* [getCredentials](#getcredentials)
* [Parameters](#parameters-1)
* [endpoints](#endpoints)
## JournalLogger
**Extends ServiceLogger**
Forward logs entries to the journal.
## FileDescriptor
Type: [Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)
### Properties
* `name` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?** 
* `fd` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** 
## credentialsDirectory
Type: [string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)
## SystemdConfig
**Extends ServiceConfig**
Provides config from CONFIGURATION\_DIRECTORY.
Also injects listeningFileDescriptors into the config
### Properties
* `configurationDirectory` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** taken from CONFIGURATION\_DIRECTORY
### listeningFileDescriptors
listeningFileDescriptors as passed in LISTEN\_FDS and LISTEN\_FDNAMES.
Returns **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)<[FileDescriptor](#filedescriptor)>** 
### loadConfig
Load config from configuration dir.
Additionally pass listeninfFileDescriptions into config.
## ServiceSystemd
**Extends ServiceProviderMixin(Service, JournalLogger, SystemdConfig)**
Kronos bridge to systemd:
* sync node state to systemd with notify
* propagate config into kronos world
* propagate socket activations into kronos (partly)
* start / stop / restart / reload initiated from systemd
* log into journal
### getCredential
Deliver credential as provided by systemd.
#### Parameters
* `key` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** 
* `options` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)?** 
Returns **[Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)<([Uint8Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array) | [string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String))>** 
### getCredentials
Deliver credentials as provided by systemd.
#### Parameters
* `keys` **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)<[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)>** 
* `options` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)?** 
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))>>** 
### endpoints
Definition of the predefined endpoints.
* info *in*
Returns **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** predefined endpoints
# install
With [npm](http://npmjs.org) do:
```shell
npm install @kronos-integration/service-systemd
```
# license
BSD-2-Clause