Answer the question
In order to leave comments, you need to log in
How to change the path to a file that is opened by a Linux application?
There is an application (no source, an executable file, let's call it "bin-py"), a specialized Python interpreter. It runs a Python script (let's call it "/mnt/ro/ro.py"), which is located on the read-only FS.
You need to add debug printing to this Python script "/mnt/ro/ro.py". To do this, this bin-py application should open instead of the script "/mnt/ro/ro.py" my script "/home/red/my.py", where there are the necessary changes.
I had an idea to do this via ltrace or strace so that they change the "filename" argument to "/home/red/my.py" to the "open" system call when "/mnt/ro/ro.py" is passed to it .
But ltrace/strace doesn't seem to have such functionality out of the box.
You can try to add such functionality to these utilities yourself, but it may be faster to take a ready-made utility, if it exists.
How can such a change be made?
There are no root rights on this machine.
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question