From 9fc58d47bfc7c8ec4fe88ccdcb8cdfaaecd56a2f Mon Sep 17 00:00:00 2001 From: James Adams Date: Wed, 11 Dec 2024 17:21:17 +0000 Subject: [PATCH 1/2] ncm-systemd: Only validate units if they are present --- .../src/main/pan/components/systemd/schema.pan | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/ncm-systemd/src/main/pan/components/systemd/schema.pan b/ncm-systemd/src/main/pan/components/systemd/schema.pan index 31e260e091..8b37395caf 100644 --- a/ncm-systemd/src/main/pan/components/systemd/schema.pan +++ b/ncm-systemd/src/main/pan/components/systemd/schema.pan @@ -545,11 +545,13 @@ type ${project.artifactId}_component = { # escaped full unitnames are allowed (or use shortnames and type) "unit" ? ${project.artifactId}_unit_type{} } with { - foreach(name; unit; SELF["unit"]) { - if (unit["type"] == "mount" && exists(unit["file"]) && exists(unit["file"]["config"]["mount"])) { - goodname = systemd_make_mountunit(unit["file"]["config"]["mount"]["Where"]); - if(goodname != name) { - error('Incorrect name for mount unit, the name must match Where: %s vs %s', name, goodname); + if (is_defined(SELF["unit"])) { + foreach(name; unit; SELF["unit"]) { + if (unit["type"] == "mount" && exists(unit["file"]) && exists(unit["file"]["config"]["mount"])) { + goodname = systemd_make_mountunit(unit["file"]["config"]["mount"]["Where"]); + if(goodname != name) { + error('Incorrect name for mount unit, the name must match Where: %s vs %s', name, goodname); + }; }; }; }; From 6ee9ea93f31d5af0fffbc31da935753d5a926e77 Mon Sep 17 00:00:00 2001 From: James Adams Date: Mon, 16 Dec 2024 14:51:56 +0000 Subject: [PATCH 2/2] ncm-systemd: Fix bug in syslog_facility regexp --- ncm-systemd/src/main/pan/components/systemd/schema.pan | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ncm-systemd/src/main/pan/components/systemd/schema.pan b/ncm-systemd/src/main/pan/components/systemd/schema.pan index 8b37395caf..8508c5b90b 100644 --- a/ncm-systemd/src/main/pan/components/systemd/schema.pan +++ b/ncm-systemd/src/main/pan/components/systemd/schema.pan @@ -17,7 +17,7 @@ type hwloc_location = string with match(SELF, '^[\w:.]+$'); syslog facility to use when logging to syslog } type syslog_facility = string with match(SELF, - '^(kern|user|mail|daemon|auth|syslog|lprnews|uucp|cron|authpriv|ftp|local[0-7])$' + '^(kern|user|mail|daemon|auth|syslog|lpr|news|uucp|cron|authpriv|ftp|local[0-7])$' ); @documentation{