pmcf 2.59.7 → 2.60.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pmcf",
3
- "version": "2.59.7",
3
+ "version": "2.60.0",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
package/src/cluster.mjs CHANGED
@@ -139,8 +139,7 @@ export class Cluster extends Host {
139
139
  ` notify_fault "/usr/bin/systemctl start ${cluster.name}-fault.target"`
140
140
  );
141
141
 
142
- cfg.push("}");
143
- cfg.push("");
142
+ cfg.push("}", "");
144
143
 
145
144
  for (const endpoint of serviceEndpoints(cluster, {
146
145
  services: { type: "http" },
package/src/host.mjs CHANGED
@@ -8,7 +8,8 @@ import {
8
8
  domainFromDominName,
9
9
  domainName,
10
10
  writeLines,
11
- sectionLines
11
+ sectionLines,
12
+ asArray
12
13
  } from "./utils.mjs";
13
14
  import { objectFilter } from "./filter.mjs";
14
15
  import { addType, types } from "./types.mjs";
@@ -457,7 +458,7 @@ export class Host extends ServiceOwner {
457
458
 
458
459
  for (const networkInterface of this.networkInterfaces.values()) {
459
460
  for (const s of networkInterface.subnets()) {
460
- sn.set(s.address,s);
461
+ sn.set(s.address, s);
461
462
  }
462
463
  }
463
464
 
@@ -514,17 +515,20 @@ export class Host extends ServiceOwner {
514
515
  await generateKnownHosts(this.owner.hosts(), join(dir, "root", ".ssh"));
515
516
 
516
517
  for (const service of this.services) {
517
- if (service.systemdConfig) {
518
- const { serviceName, configFileName, content } = service.systemdConfig(
519
- this.name
520
- );
521
- await writeLines(dir, configFileName, sectionLines(...content));
522
-
523
- addHook(
524
- packageData.properties.hooks,
525
- "post_install",
526
- `systemctl enable ${serviceName}.service`
527
- );
518
+ if (service.systemdConfigs) {
519
+ for (const {
520
+ serviceName,
521
+ configFileName,
522
+ content
523
+ } of asArray(service.systemdConfigs(this.name))) {
524
+ await writeLines(dir, configFileName, sectionLines(...content));
525
+
526
+ addHook(
527
+ packageData.properties.hooks,
528
+ "post_install",
529
+ `systemctl enable ${serviceName}`
530
+ );
531
+ }
528
532
  }
529
533
  }
530
534
 
@@ -32,11 +32,16 @@ export class SystemdJournalRemoteService extends Service {
32
32
  return SystemdJournalRemoteServiceTypeDefinition.name;
33
33
  }
34
34
 
35
- systemdConfig(name) {
36
- return {
37
- serviceName: "systemd-journal-remote",
38
- configFileName: `etc/systemd/journal-remote.conf.d/${name}.conf`,
39
- content: ["Remote", {}]
40
- };
35
+ systemdConfigs(name) {
36
+ return [
37
+ {
38
+ serviceName: "systemd-journal-remote.service",
39
+ configFileName: `etc/systemd/journal-remote.conf.d/${name}.conf`,
40
+ content: ["Remote", {}]
41
+ } /*,
42
+ {
43
+ serviceName: "systemd-journal-remote.socket"
44
+ }*/
45
+ ];
41
46
  }
42
47
  }
@@ -34,9 +34,9 @@ export class SystemdJournalUploadService extends Service {
34
34
  return SystemdJournalUploadServiceTypeDefinition.name;
35
35
  }
36
36
 
37
- systemdConfig(name) {
37
+ systemdConfigs(name) {
38
38
  return {
39
- serviceName: "systemd-journal-upload",
39
+ serviceName: "systemd-journal-upload.service",
40
40
  configFileName: `etc/systemd/journal-upload.conf.d/${name}.conf`,
41
41
  content: ["Upload", {
42
42
  URL : this.url
@@ -32,7 +32,7 @@ export class SystemdJournalService extends Service {
32
32
  return SystemdJournalServiceTypeDefinition.name;
33
33
  }
34
34
 
35
- systemdConfig(name) {
35
+ systemdConfigs(name) {
36
36
  return {
37
37
  serviceName: "systemd-journald",
38
38
  configFileName: `etc/systemd/journal.conf.d/${name}.conf`,
@@ -36,7 +36,7 @@ export class SystemdResolvedService extends ExtraSourceService {
36
36
  return SystemdResolvedServiceTypeDefinition.name;
37
37
  }
38
38
 
39
- systemdConfig(name) {
39
+ systemdConfigs(name) {
40
40
  const options = (priority, limit) => {
41
41
  return {
42
42
  services: { type: "dns", priority },
@@ -48,7 +48,7 @@ export class SystemdResolvedService extends ExtraSourceService {
48
48
  };
49
49
 
50
50
  return {
51
- serviceName: "systemd-resolved",
51
+ serviceName: "systemd-resolved.service",
52
52
  configFileName: `etc/systemd/resolved.conf.d/${name}.conf`,
53
53
  content: [
54
54
  "Resolve",
@@ -36,9 +36,9 @@ export class SystemdTimesyncdService extends ExtraSourceService {
36
36
  return SystemdTimesyncdServiceTypeDefinition.name;
37
37
  }
38
38
 
39
- systemdConfig(name) {
39
+ systemdConfigs(name) {
40
40
  return {
41
- serviceName: "systemd-timesyncd",
41
+ serviceName: "systemd-timesyncd.service",
42
42
  configFileName: `etc/systemd/timesyncd.conf.d/${name}.conf`,
43
43
  content: [
44
44
  "Time",
@@ -245,10 +245,10 @@ export class SystemdJournalRemoteService extends Service {
245
245
  };
246
246
  get type(): string;
247
247
  get systemdServices(): string;
248
- systemdConfig(name: any): {
248
+ systemdConfigs(name: any): {
249
249
  serviceName: string;
250
250
  configFileName: string;
251
251
  content: {}[];
252
- };
252
+ }[];
253
253
  }
254
254
  import { Service } from "pmcf";
@@ -251,7 +251,7 @@ export class SystemdJournalUploadService extends Service {
251
251
  };
252
252
  get type(): string;
253
253
  get systemdServices(): string;
254
- systemdConfig(name: any): {
254
+ systemdConfigs(name: any): {
255
255
  serviceName: string;
256
256
  configFileName: string;
257
257
  content: (string | {
@@ -245,7 +245,7 @@ export class SystemdJournalService extends Service {
245
245
  };
246
246
  get type(): string;
247
247
  get systemdServices(): string;
248
- systemdConfig(name: any): {
248
+ systemdConfigs(name: any): {
249
249
  serviceName: string;
250
250
  configFileName: string;
251
251
  content: (string | {
@@ -244,7 +244,7 @@ export class SystemdResolvedService extends ExtraSourceService {
244
244
  properties: {};
245
245
  };
246
246
  get systemdServices(): string;
247
- systemdConfig(name: any): {
247
+ systemdConfigs(name: any): {
248
248
  serviceName: string;
249
249
  configFileName: string;
250
250
  content: (string | {
@@ -244,7 +244,7 @@ export class SystemdTimesyncdService extends ExtraSourceService {
244
244
  properties: {};
245
245
  };
246
246
  get systemdServices(): string;
247
- systemdConfig(name: any): {
247
+ systemdConfigs(name: any): {
248
248
  serviceName: string;
249
249
  configFileName: string;
250
250
  content: (string | {