Pipes instead of command line and random locks
Opened this issue · 5 comments
Hi all,
I suggest a solution (at least in my experience), for a couple of questions appearing among the Issues.
- Remove the limitations of command line length limits and exposability by using pipes instead of command line to pass the script to the interpreter. A -P option is added to enable this.
- Remove occasional locks introduced by a race condition in the untraceable() function: the possibility that the CONT signal arrives before the process has actually entered the stopped state, being therefore discarded.
- Add support for python script.
Sorry, I'm not familiar with the mechanism of pull request and so on, but all the stuff is simple enough to be manageable by a simple:
patch shc.c shc.patch
againt the current master branch, where shc.patch is extracted from:
shcpatch.zip
A drawback of the "pipe" feature, is the fact that the script may lose the possibility to retrieve the original name by accessing $0, $ARGV[0]
or sys.argv[0]
(depending on the language). Often this can be worked around referring to the $_ environment variable, but not always. In exchange for this annoyance, the limit on the script size and the possibility of seeing the source in clear with ps
or /proc/*/cmdline
both disappear.
The patch has been applied to the "original" v3, and has been working reliably for years under linux. Only recently I discovered this git repo with the updated version.
The patch has been applied to the "original" v3,
could you please provide a link
Hi neurobin,
I mean the one found in Francisco Rosales' page.
I applied those modifications years ago to that source file, and used afterwards.
But the patch file I sent is to be applied to the current master version of this git.
Sorry, I'm not familiar with the mechanism of pull request
you just need to fork this repository, then apply your patches, then push. After that you can go to https://github.com/neurobin/shc/pulls to create a PR.
Done. I hope it will be useful.
Just find out I implemented almost the same idea as this solution, except the anoymous pipe / fifo difference.
https://github.com/liberize/ssc