${PROJECT_NAME}
should be your own project name.
$ gcloud functions deploy helloExec --trigger-http --project=${PROJECT_NAME}
$ curl "https://us-central1-${PROJECT_NAME}.cloudfunctions.net/helloExec" -d '{"file": "/bin/cat", "args": ["/proc/filesystems"]}' -H 'Content-Type:application/json'
*stdout*:
nodev 9p
nodev devtmpfs
nodev proc
nodev ramdiskfs
nodev sysfs
nodev tmpfs
$ curl "https://us-central1-${PROJECT_NAME}.cloudfunctions.net/helloExec" -d '{"file": "/bin/cat", "args": ["/proc/stat"]}' -H 'Content-Type:application/json'
*stdout*:
cpu 0 0 0 0 0 0 0 0 0 0
cpu0 0 0 0 0 0 0 0 0 0 0
cpu1 0 0 0 0 0 0 0 0 0 0
cpu2 0 0 0 0 0 0 0 0 0 0
cpu3 0 0 0 0 0 0 0 0 0 0
cpu4 0 0 0 0 0 0 0 0 0 0
cpu5 0 0 0 0 0 0 0 0 0 0
cpu6 0 0 0 0 0 0 0 0 0 0
cpu7 0 0 0 0 0 0 0 0 0 0
intr 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
ctxt 0
btime 1527423521
processes 0
procs_running 0
procs_blocked 0
softirq 0 0 0 0 0 0 0 0 0 0 0
They are the same output with the gVisor document(/proc/filesystem
, /proc/stat
).
Thanks to s.hiruta's method.
You can read a easter egg by exec dmesg
.
$ curl "https://us-central1-${PROJECT_NAME}.cloudfunctions.net/helloExec" -d '{"file": "/bin/dmesg", "args": []}' -H 'Content-Type:application/json'
*stdout*:
[ 0.086696] Rewriting operating system in Javascript...
[ 0.543600] Forking spaghetti code...
[ 0.660117] Creating bureaucratic processes...
[ 0.913005] Feeding the init monster...
[ 0.922419] Segmenting fault lines...
[ 1.072444] Searching for socket adapter...
[ 1.249616] Creating process schedule...
[ 1.472052] Synthesizing system calls...
[ 1.862931] Generating random numbers by fair dice roll...
[ 2.167452] Waiting for children...
[ 2.481318] Ready!