Better way to get secrets into systemd units?

There are other options:

  1. you can run an ExecStartPre as root even with DynamicUser like this: ExecStartPre = "!/some/binary/somewhere";
  2. alternatively, create a separate foo-config.service that runs as root which is responsible for doing all the setup.
1 Like