Re-Introduce process file lock

Overview

In !1496 (merged) we introduced locking so we can only have 1 GitLab Runner process running on the same process, this lock was done to prevent issues like #3688 (closed) as explained in detail in #4407 (closed). This caused a good point of problems/regressions listed below. Given that at this point file locking is causing more headaches to users then is solving, we should revert this change completely for now and then decide on a proper solution now that we have all this information/feedback from users.

We can make this locking a soft requirement but this does not solve #5024

Problems/Regressions

Merge Requests

Proposal

Criteras

  • When introducing file locking, make it a soft requirement. Meaning if we fail to create the lock file, still, start the Runner process just log a warning
  • Make sure there are not regressions like the one above
  • Prevent two runner processes using the same config.toml file

Ideas

  • One possible solution is to use the tmp directory as proposed in !1700 (closed), but also not ideal since it's the /tmp directory which can be disabled by the user and /tmp can be removed/deleted at any time.
  • Add a new field in config.toml to specify where the lock file should be defined.