Skip to content

Logic error if file copy required in subdirectory already referenced by a symlink entry #218

@srd424

Description

@srd424

Describe the bug

      etc = {
        "systemd/network/wg0.netdev" =
          { source = ./etc/wg0.netdev;              user = "root"; group = "root"; mode = "0640"; };

This should copy the file not symlink it, but:

[2025-03-24T21:33:42Z DEBUG system_manager::activate::etc_files] Entering into directory /etc/systemd...
[2025-03-24T21:33:42Z DEBUG system_manager::activate::etc_files] Entering into directory /etc/systemd/network...
[2025-03-24T21:33:42Z INFO  system_manager] Creating symlink: /etc/systemd/network/wg0.netdev -> ./../../.system-manager-static/systemd/network/wg0.netdev
[2025-03-24T21:33:42Z INFO  system_manager] Creating symlink: /etc/systemd/network/wg0.netdev.mode -> ./../../.system-manager-static/systemd/network/wg0.netdev.mode
[2025-03-24T21:33:42Z INFO  system_manager] Creating symlink: /etc/systemd/network/wg0.netdev.uid -> ./../../.system-manager-static/systemd/network/wg0.netdev.uid
[2025-03-24T21:33:42Z INFO  system_manager] Creating symlink: /etc/systemd/network/wg0.netdev.gid -> ./../../.system-manager-static/systemd/network/wg0.netdev.gid
[2025-03-24T21:33:42Z DEBUG system_manager::activate::etc_files] Entering into directory /etc/systemd/system...
[2025-03-24T21:33:42Z INFO  system_manager] Creating symlink: /etc/systemd/system/system-manager-path.service -> ./../../.system-manager-static/systemd/system/system-manager-path.service

To Reproduce

The above snippet should be good enough - I believe the automatically added components under systemd/system trigger the error in combination with it.

Expected behavior

The file should copied, not symlinked, and symlinks should not be made to xxx.uid, xxx.gid, xxx.mode, etc.

System information

HEAD as of time of writing.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions