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 +1 -1
- package/src/host.mjs +10 -3
- package/src/services/systemd-journal.mjs +2 -1
- package/src/services/systemd-resolved.mjs +2 -1
- package/src/services/systemd-timesyncd.mjs +2 -1
- package/types/services/systemd-journal.d.mts +2 -1
- package/types/services/systemd-resolved.d.mts +2 -1
- package/types/services/systemd-timesyncd.d.mts +2 -1
package/package.json
CHANGED
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 {
|
|
497
|
-
await writeLines(dir,
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
248
|
+
serviceName: string;
|
|
249
|
+
configFileName: string;
|
|
249
250
|
content: (string | {
|
|
250
251
|
NTP: any;
|
|
251
252
|
})[];
|