Skip to content

RFE: credentials loaded with LoadCredential should be available to ExecStartPre too #19604

@happysalada

Description

@happysalada

This is just asking precision around the LoadCredential doc.

I couldn't understand how to actually use the feature.

The way i understood it was:
In order to pass an environment variable SECRET_KEY_BASE to a service

  • add a LoadCredential=secret_key_base:/run/secrets/unionBlue.secret_key_base.
  • then add an environment variable SECRET_KEY_BASE=$CREDENTIALS_DIRECTORY/secret_key_base;
    I made sure that the /run/secrets/unionBlue.secret_key_base file (just a text file) is owned by the same user running the service.
    However upon starting the service I run into the following errors
72670]: union-blue.service: Failed to set up mount namespacing: /run/systemd/unit-root/run/credentials/union-blue.service: No such file or directory
72670]: union-blue.service: Failed at step NAMESPACE spawning /nix/store/sxpb7vbxx1kwprnhsvr2cn7l0vssl9r2-union-0.0.1/bin/union: No such file or directory

I'm not sure what I missed.
I'm happy to test any suggestions and propose an amendment to the documentation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    RFE 🎁Request for Enhancement, i.e. a feature requestpid1

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions