Skip to content

Resolve "Text file busy @ rb_sysopen error when running 'gdk start'"

What does this Merge Request do and why?

This MR aims to solve an occasional issue when running gdk stop/start that results in errors like /builds/gitlab-org/gitlab-development-kit/gdk/lib/runit/config.rb:218:in initialize': Text file busy @ rb_sysopen - /builds/gitlab-org/gitlab-development-kit/gdk/sv/praefect/run (Errno::ETXTBSY)`.

The fix is two fold:

  • When attempting to write to a file that's executing, catch the Errno::ETXTBSY exception as that's what's thrown. There doesn't appear to be a way to ask if a file is currently being executed unfortunately.
  • Only write out runit sv/<service/* files if the content differs, which will also make running gdk stop/start more efficient.

Merge Request checklist

  • This change is backward compatible. If not, please include steps to communicate to our users.
  • Tests added for new functionality. If not, please raise Issue to follow-up.
  • Documentation added/updated, if needed.
  • gdk doctor test added, if needed.
  • Add the ~highlight label if this MR should be included in the CHANGELOG.md.

Closes #1486 (closed)

Edited by Ash McKenzie

Merge request reports