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

Fix SFTPGo service port check in restore action #72

Closed
wants to merge 2 commits into from

Conversation

stephdl
Copy link
Collaborator

@stephdl stephdl commented Sep 2, 2024

The pull request fixes an issue where the SFTPGo service port was not properly checked before starting it in the restore action. The commit adds a new function to check if the port is in use for both IPv4 and IPv6. If the port is not in use, the service is started successfully. If the port is already in use, a message is printed to indicate that the service needs to be restarted manually later.

NethServer/dev#7001

Copy link
Member

@DavidePrincipi DavidePrincipi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The fix moves transforms the original issue into something else that the user must address anyway at some time in the future. I can approve, but

  1. restart is not needed after enable --now.
  2. patch size can be smaller: if the port is in use, exit immediately.

Edit: why not using agent.tcp_port_in_use() instead of defining a similar function here?

@stephdl
Copy link
Collaborator Author

stephdl commented Sep 4, 2024

For now I close this PR, the fix cannot be for webserver but it needs a more complex solution in the restoration process, we have many other apps concerned by the same behavior, the fact the static port is still used by the previous module or the restoration of the module as new module causes trouble because a static port cannot be bound two times

https://mattermost.nethesis.it/nethesis/pl/grp4er6qpfnt7q13k8caydh73w

@stephdl stephdl closed this Sep 4, 2024
@stephdl stephdl deleted the test_sftp_port branch September 4, 2024 08:11
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 this pull request may close these issues.

2 participants