diff --git a/buildpack/core/runtime.py b/buildpack/core/runtime.py index a9e79c6a1..9e6c332b0 100644 --- a/buildpack/core/runtime.py +++ b/buildpack/core/runtime.py @@ -68,6 +68,13 @@ def stage(buildpack_dir, build_path, cache_path): os.path.join(buildpack_dir, "etc", "m2ee", "m2ee.yaml"), os.path.join(build_path, ".local", "m2ee.yaml"), ) + shutil.copytree( + os.path.join(buildpack_dir, "etc", "scripts"), + os.path.join(build_path, ".local", "scripts"), + dirs_exist_ok=True, + copy_function=shutil.copy2 + ) + resolve_runtime_dependency(buildpack_dir, build_path, cache_path) @@ -614,7 +621,7 @@ def _pre_process_m2ee_yaml(): f"s|BUILD_PATH|{os.getcwd()}|g; " f"s|RUNTIME_PORT|{util.get_runtime_port()}|; " f"s|ADMIN_PORT|{util.get_admin_port()}|; " - f"s|PYTHONPID|{os.getpid()}|", + f"s|PYTHONPID|{os.getpid()}|", # TODO Replace in new scripts ".local/m2ee.yaml", ] ) diff --git a/etc/m2ee/m2ee.yaml b/etc/m2ee/m2ee.yaml index 5f00c57c4..d46378a28 100644 --- a/etc/m2ee/m2ee.yaml +++ b/etc/m2ee/m2ee.yaml @@ -23,9 +23,10 @@ m2ee: [ "-Dfile.encoding=UTF-8", "-Djava.io.tmpdir=/tmp", - "-XX:OnError=/home/vcap/app/on_error_script.sh", - "-XX:OnOutOfMemoryError=/home/vcap/app/on_oom.sh", + "-XX:OnError=/home/vcap/app/.local/scripts/on_error.sh", + "-XX:OnOutOfMemoryError=/home/vcap/app/.local/scripts/on_out_of_memory_error.sh", ] + # TODO Replace with BUILD_PATH jetty: max_form_content_size: 10485760 diff --git a/etc/scripts/on_error.sh b/etc/scripts/on_error.sh new file mode 100755 index 000000000..8eb9f2123 --- /dev/null +++ b/etc/scripts/on_error.sh @@ -0,0 +1,2 @@ +echo "### THIS IS ON ERROR SCRIPT ###" +# TODO Write actual signal command \ No newline at end of file diff --git a/etc/scripts/on_out_of_memory_error.sh b/etc/scripts/on_out_of_memory_error.sh new file mode 100755 index 000000000..e63c53eef --- /dev/null +++ b/etc/scripts/on_out_of_memory_error.sh @@ -0,0 +1,2 @@ +echo "### THIS IS ON OOM SCRIPT ###" +# TODO Write actual signal command \ No newline at end of file