Skip to content

Commit 7131f53

Browse files
committed
added wrapper and launch_r scripts
1 parent 5200db3 commit 7131f53

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

scripts/allow_ptrace.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#include <sys/prctl.h>
2+
3+
__attribute__((constructor))
4+
static void allow_ptrace(void) {
5+
prctl(PR_SET_PTRACER, PR_SET_PTRACER_ANY);
6+
}

scripts/launch_r.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/usr/bin/env bash
2+
export LD_PRELOAD=/workspaces/r-dev-env/scripts/allow_ptrace.so
3+
4+
# If the first argument is a file, use that as R_BINARY; otherwise default.
5+
if [ -x "$1" ]; then
6+
R_BINARY="$1"
7+
shift
8+
else
9+
R_BINARY="/usr/bin/R"
10+
fi
11+
12+
# Exec R with all remaining arguments
13+
exec "$R_BINARY" "$@"

0 commit comments

Comments
 (0)