Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

copy.DirCopy fails when encountering sockets #2113

Closed
anderbubble opened this issue Sep 27, 2024 · 3 comments · Fixed by #2117
Closed

copy.DirCopy fails when encountering sockets #2113

anderbubble opened this issue Sep 27, 2024 · 3 comments · Fixed by #2117

Comments

@anderbubble
Copy link
Contributor

We use copy.DirCopy and have encountered a behavior that, if the source contains sockets, the copy operation fails with an error of the form:

lchown /var/lib/warewulf/chroots/gpuslurm/rootfs/run/user/0/gnupg/d.kg8ijih5tq41ixoeag4p1qup/S.gpg-agent: no such file or directory

Could copy.DirCopy be updated to ignore sockets in the source in stead?

Reported for Warewulf at warewulf/warewulf#892

@giuseppe
Copy link
Member

yes, I think we should skip sockets. Would you like to open a PR?

@anderbubble
Copy link
Contributor Author

yes, I think we should skip sockets. Would you like to open a PR?

I'll have a look; thanks!

anderbubble added a commit to anderbubble/storage that referenced this issue Sep 27, 2024
- Closes containers#2113

copy.DirCopy contains code to create named sockets matching those on the
source; however, this operation closes the socket, removing it
implicitly from the destination and causing later chown and chmod
operations to fail.

This commit removes the `.close()` operation, leaving the socket in
place at the destination, as it is in the source.

Signed-off-by: Jonathon Anderson <[email protected]>
anderbubble added a commit to anderbubble/storage that referenced this issue Sep 27, 2024
- Closes containers#2113

copy.DirCopy contains code to create named sockets matching those on the
source; however, this operation closes the socket, removing it
implicitly from the destination and causing later chown and chmod
operations to fail.

This commit removes the `.close()` operation, leaving the socket in
place at the destination, as it is in the source.

Signed-off-by: Jonathon Anderson <[email protected]>
anderbubble added a commit to anderbubble/storage that referenced this issue Sep 27, 2024
- Closes containers#2113

copy.DirCopy contains code to create named sockets matching those on the
source; however, this operation closes the socket, removing it
implicitly from the destination and causing later chown and chmod
operations to fail.

This commit removes the `.close()` operation, leaving the socket in
place at the destination, as it is in the source.

Signed-off-by: Jonathon Anderson <[email protected]>
@anderbubble
Copy link
Contributor Author

@giuseppe PR submitted. Thanks for the support! Let me know if there's anything else you need from me, particularly to get it backported to a release that supports go 1.21 or earlier.

anderbubble added a commit to anderbubble/storage that referenced this issue Sep 28, 2024
- Closes containers#2113

copy.DirCopy contains code to create named sockets matching those on the
source; however, this operation closes the socket, removing it
implicitly from the destination and causing later chown and chmod
operations to fail.

This commit removes configures the socket to not unlink the underlying
socket file from the file system during `.Close()`, leaving the socket
in place at the destination, as it is in the source.

Signed-off-by: Jonathon Anderson <[email protected]>
anderbubble added a commit to anderbubble/storage that referenced this issue Sep 28, 2024
- Closes containers#2113

`copy.DirCopy` contains code to create named sockets matching those on
the source; however, this operation closes the socket, removing it
implicitly from the destination and causing later chown and chmod
operations to fail.

This commit removes configures the socket to not unlink the underlying
socket file from the file system during `.Close()`, leaving the socket
in place at the destination, as it is in the source.

Signed-off-by: Jonathon Anderson <[email protected]>
anderbubble added a commit to anderbubble/storage that referenced this issue Sep 28, 2024
- Closes containers#2113

`copy.DirCopy` contains code to create named sockets matching those on
the source; however, this operation closes the socket, removing it
implicitly from the destination and causing later chown and chmod
operations to fail.

This commit removes configures the socket to not unlink the underlying
socket file from the file system during `.Close()`, leaving the socket
in place at the destination, as it is in the source.

Signed-off-by: Jonathon Anderson <[email protected]>
anderbubble added a commit to anderbubble/storage that referenced this issue Sep 28, 2024
- Closes containers#2113

`copy.DirCopy` contains code to create named sockets matching those on
the source; however, this operation closes the socket, removing it
implicitly from the destination and causing later chown and chmod
operations to fail.

This commit removes configures the socket to not unlink the underlying
socket file from the file system during `.Close()`, leaving the socket
in place at the destination, as it is in the source.

Signed-off-by: Jonathon Anderson <[email protected]>
anderbubble added a commit to anderbubble/storage that referenced this issue Sep 28, 2024
- Closes containers#2113

`copy.DirCopy` contains code to create named sockets matching those on
the source; however, this operation closes the socket, removing it
implicitly from the destination and causing later chown and chmod
operations to fail.

This commit removes configures the socket to not unlink the underlying
socket file from the file system during `.Close()`, leaving the socket
in place at the destination, as it is in the source.

Signed-off-by: Jonathon Anderson <[email protected]>
anderbubble added a commit to anderbubble/storage that referenced this issue Sep 28, 2024
- Closes containers#2113

`copy.DirCopy` contains code to create named sockets matching those on
the source; however, this operation closes the socket, removing it
implicitly from the destination and causing later chown and chmod
operations to fail.

This commit removes configures the socket to not unlink the underlying
socket file from the file system during `.Close()`, leaving the socket
in place at the destination, as it is in the source.

Signed-off-by: Jonathon Anderson <[email protected]>
anderbubble added a commit to anderbubble/storage that referenced this issue Sep 28, 2024
- Closes containers#2113

`copy.DirCopy` contains code to create named sockets matching those on
the source; however, this operation closes the socket, removing it
implicitly from the destination and causing later chown and chmod
operations to fail.

This commit removes configures the socket to not unlink the underlying
socket file from the file system during `.Close()`, leaving the socket
in place at the destination, as it is in the source.

Signed-off-by: Jonathon Anderson <[email protected]>
anderbubble added a commit to anderbubble/storage that referenced this issue Oct 30, 2024
- Closes containers#2113

`copy.DirCopy` contains code to create named sockets matching those on
the source; however, this operation closes the socket, removing it
implicitly from the destination and causing later chown and chmod
operations to fail.

This commit creates matching file system nodes directly without opening
a socket or invoking the auto-removal semantics of a listener.

Signed-off-by: Jonathon Anderson <[email protected]>
anderbubble added a commit to anderbubble/storage that referenced this issue Oct 30, 2024
- Closes containers#2113

`copy.DirCopy` contains code to create named sockets matching those on
the source; however, this operation closes the socket, removing it
implicitly from the destination and causing later chown and chmod
operations to fail.

This commit creates matching file system nodes directly without opening
a socket or invoking the auto-removal semantics of a listener.

Signed-off-by: Jonathon Anderson <[email protected]>
anderbubble added a commit to anderbubble/storage that referenced this issue Oct 30, 2024
- Closes containers#2113

`copy.DirCopy` contains code to create named sockets matching those on
the source; however, this operation closes the socket, removing it
implicitly from the destination and causing later chown and chmod
operations to fail.

This commit creates matching file system nodes directly without opening
a socket or invoking the auto-removal semantics of a listener.

Signed-off-by: Jonathon Anderson <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants