diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 13ec231513..7a1bfa4e8e 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -44,6 +44,9 @@ Fixed * Update importlib-metadata from 3.10.1 to 4.8.3 for py3.6 and to 4.10.1 for py3.8 (security). #6072 Contributed by @jk464 +* For "local-shell-script" runner, on readonly filesystems, don't attempt to run chmod +x on script_action. Fixes #5591 + Contributed by @jk464 + Added ~~~~~ * Move `git clone` to `user_home/.st2packs` #5845 diff --git a/contrib/runners/local_runner/local_runner/base.py b/contrib/runners/local_runner/local_runner/base.py index 4fda9c1866..436d7dbf6b 100644 --- a/contrib/runners/local_runner/local_runner/base.py +++ b/contrib/runners/local_runner/local_runner/base.py @@ -116,7 +116,10 @@ def _run(self, action): sanitized_args = action.get_sanitized_full_command_string() # For consistency with the old Fabric based runner, make sure the file is executable - if script_action: + # Also check to ensure not Read-only file system + if script_action and not bool( + os.statvfs(self.entry_point).f_flag & os.ST_RDONLY + ): script_local_path_abs = self.entry_point args = "chmod +x %s ; %s" % (script_local_path_abs, args) sanitized_args = "chmod +x %s ; %s" % (