pmcf 2.41.2 → 2.42.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.41.2",
3
+ "version": "2.42.0",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
package/src/host.mjs CHANGED
@@ -3,6 +3,7 @@ import { join } from "node:path";
3
3
  import { FileContentProvider } from "npm-pkgbuild";
4
4
  import { ServiceOwner, Base, addresses } from "pmcf";
5
5
  import { networkAddressProperties } from "./network-support.mjs";
6
+ import { addHook } from "./hooks.mjs";
6
7
  import {
7
8
  domainFromDominName,
8
9
  domainName,
@@ -492,9 +493,15 @@ export class Host extends ServiceOwner {
492
493
  await generateKnownHosts(this.owner.hosts(), join(dir, "root", ".ssh"));
493
494
 
494
495
  for (const service of this.services) {
495
- if (service.systemdConfig) {
496
- const { name, content } = service.systemdConfig(this.name);
497
- await writeLines(dir, name, sectionLines(...content));
496
+ if (service.systemdConfig) {
497
+ const { serviceName, configFileName, content } = service.systemdConfig(this.name);
498
+ await writeLines(dir, configFileName, sectionLines(...content));
499
+
500
+ addHook(
501
+ packageData.properties.hooks,
502
+ "post_install",
503
+ `systemctl enable ${serviceName}.service`
504
+ );
498
505
  }
499
506
  }
500
507
 
@@ -34,7 +34,8 @@ export class SystemdJournalService extends Service {
34
34
 
35
35
  systemdConfig(name) {
36
36
  return {
37
- name: `etc/systemd/journal.conf.d/${name}.conf`,
37
+ serviceName: "systemd-journald",
38
+ configFileName: `etc/systemd/journal.conf.d/${name}.conf`,
38
39
  content: [
39
40
  "Journal",
40
41
  {
@@ -48,7 +48,8 @@ export class SystemdResolvedService extends ExtraSourceService {
48
48
  };
49
49
 
50
50
  return {
51
- name: `etc/systemd/resolved.conf.d/${name}.conf`,
51
+ serviceName: "systemd-resolved",
52
+ configFileName: `etc/systemd/resolved.conf.d/${name}.conf`,
52
53
  content: [
53
54
  "Resolve",
54
55
  {
@@ -38,7 +38,8 @@ export class SystemdTimesyncdService extends ExtraSourceService {
38
38
 
39
39
  systemdConfig(name) {
40
40
  return {
41
- name: `etc/systemd/timesyncd.conf.d/${name}.conf`,
41
+ serviceName: "systemd-timesyncd",
42
+ configFileName: `etc/systemd/timesyncd.conf.d/${name}.conf`,
42
43
  content: [
43
44
  "Time",
44
45
  {
@@ -246,7 +246,8 @@ export class SystemdJournalService extends Service {
246
246
  get type(): string;
247
247
  get systemdServices(): string;
248
248
  systemdConfig(name: any): {
249
- name: string;
249
+ serviceName: string;
250
+ configFileName: string;
250
251
  content: (string | {
251
252
  Compress: string;
252
253
  SystemMaxUse: string;
@@ -245,7 +245,8 @@ export class SystemdResolvedService extends ExtraSourceService {
245
245
  };
246
246
  get systemdServices(): string;
247
247
  systemdConfig(name: any): {
248
- name: string;
248
+ serviceName: string;
249
+ configFileName: string;
249
250
  content: (string | {
250
251
  DNS: any;
251
252
  FallbackDNS: any;
@@ -245,7 +245,8 @@ export class SystemdTimesyncdService extends ExtraSourceService {
245
245
  };
246
246
  get systemdServices(): string;
247
247
  systemdConfig(name: any): {
248
- name: string;
248
+ serviceName: string;
249
+ configFileName: string;
249
250
  content: (string | {
250
251
  NTP: any;
251
252
  })[];