Skip to content

'@systemd-js/conf' readme example is raising an error #35

@axel7083

Description

@axel7083

I was trying the example in the README Create service unit for ini string and modify service user definition. which is the following.

const unit = `
[Unit]
Description=example
After=network.target

[Install]
WantedBy=multi-user.target

[Service]
ExecPreStart=/opt/example/agent start-1
ExecPreStart=/opt/example/agent start-2
ExecStart=/opt/example/agent start
EnvironmentFile=/opt/example/.env
Restart=always
PrivateTmp=yes
User=root
`;

const ini = INI.fromString(unit);
const service = Service.fromINI(ini);

But I am getting the following error

ZodError: [
  {
    "code": "unrecognized_keys",
    "keys": [
      "ExecPreStart",
      "PrivateTmp"
    ],
    "path": [
      "Service"
    ],
    "message": "Unrecognized key(s) in object: 'ExecPreStart', 'PrivateTmp'"
  }
]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions