Repository navigation
fix restart after the running exe is replaced on linux - #218
Merged
Merged
Conversation
…ed)" On linux `current_exe()` reads `/proc/self/exe`, which reports "<path> (deleted)" once `self_replace` unlinks the running inode, so `restart()` exec'd a missing file (#217). `install_binary` now records the pre-replace path for `restart`, and `restart` falls back to stripping the suffix when nothing was recorded.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #217
current_exe()path ininstall_binaryafter an in-placeself_replace, and restart into it. On linuxcurrent_exe()reports"<path> (deleted)"once the running inode is unlinked, sorestart()exec'd a missing file." (deleted)"suffix (linux/android only) when no path was recorded and the stripped path exists.restart_with_reexecs_after_exe_replaced_on_disktotests/restart.rs: a copy of the test binary renames a fresh copy over itself, then callsrestart_with. Fails withNo such file or directorybefore the fix.specs/ref-restart.mdandCHANGELOG.md.