3 ms·
Even when allowing incremental reading of the script, it would be safer to use inotify to detect changes to the script being executed and fail when changes are
by ArchD 6y ago
Even when allowing incremental reading of the script, it would be safer to use inotify to detect changes to the script being executed and fail when changes are detected.
Also, flock() could be used to signal to other processes that the script file is not to be written to.
- smichel17 6y agoThis seems like the correct solution to me. If I run a 4GB script (eg, a self-extracting script with a zip embedded, like another comment mentioned), I don't want to oom myself. Locking during execution or exiting with an appropriate error code seems like much more desirable behavior.