Trying to make a directory from systemd results in a 127 error code

Wonderful. Thank you. That is the way to go. That tmpfiles name did throw my off, but it seems to stick.

However, I have one challenge left. I still need to run mount. This needs to be done as root. So, updated the service to:

Service = {
  User = "root";
  Group = "root";
  ExecStart = "${pkgs.writeShellScript "syncdir-setup" ''
    mount -o bind --source /home/dob/syncDir --target /home/dob/nextcloud/syncDir
  ''}";
};

Note: I have tried with {coreutils}/bin/mount as well.

This failed with ā€œChanging group credentials failed: Operation not permittedā€. I have seen this related post, but I do not see what I am missing.

Or, is there a better way to do mounts as well?

UPDATE:

I just discovered systemd.user.mounts, so I will investigate that!

1 Like