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

Persistent go-ios agent after the initial go-ios terminates. #560

Merged
merged 4 commits into from
Feb 11, 2025

Conversation

stoktamisoglu
Copy link
Contributor

@stoktamisoglu stoktamisoglu commented Feb 9, 2025

When go-ios is started in agent mode, the agent terminates when the parent go-ios process terminates. If you run go-ios in multiple terminal for multiple device test automation the this can disrupt other terminal sessions which may be using the first started tunnel.

With this PR we use SysProcAttr for *nix and Window platforms.

For *nix platforms setting Setsid: true starts agent in an independent new *nix session. And for windows as this setting is not available by OS nature we can use CreationFlags: syscall.CREATE_NEW_PROCESS_GROUP to start the process in a new process group.

They are tested on *nix and Windows and works well.

@stoktamisoglu
Copy link
Contributor Author

Hi @dmissmann and @danielpaulus , would you review the #560 at your conveniences?

Copy link
Collaborator

@dmissmann dmissmann left a comment

Choose a reason for hiding this comment

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

That makes sense, but do I get it right that now the only way to kill the agent in the background is with a kill ... command?

@dmissmann dmissmann merged commit 1a76f14 into danielpaulus:main Feb 11, 2025
2 checks passed
@stoktamisoglu
Copy link
Contributor Author

That makes sense, but do I get it right that now the only way to kill the agent in the background is with a kill ... command?

Thanks for the review @dmissmann.

Formal and graceful way to terminate the tunnel is still
go-ios tunnel stopagent

Of course, kill and and the signals are still alternative to stop the tunnel.

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