/usr/src/blcr-0.8.5/tests/ruby_test.sh is in blcr-dkms 0.8.5-2.1.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 | #!/bin/sh
# First check that we *have* ruby
ruby -e '' || exit 77
. ${cr_testsdir:-`dirname $0`}/shellinit
\rm -f Context[123] .Context[123].tmp 2>/dev/null
bash <<-'__EOF__'
exec 2>/dev/null # Drop job control message(s) from the outer script
echo '#ST_ALARM:120'
$cr_run ruby -e '
include Process
STDOUT.sync=true
$chkpt_cmd = ENV['\''cr_checkpoint'\'']
$rstrt_cmd = ENV['\''cr_restart'\'']
def checkpoint(file,pid)
system "#{$chkpt_cmd} --file=#{file} --kill --tree #{pid}"
waitpid(pid) if pid != $$
sleep 1
end
def restart(file)
pid = fork { exec "#{$rstrt_cmd} #{file}" }
sleep 3
return pid
end
pid = fork { 0.upto(15) {|n| print "#{n} Hello\n"; sleep 1} }
sleep 3
print "# Checkpoint original child\n"
checkpoint("Context1",pid)
print "# Restart 1\n"
pid = restart "Context1"
print "# Checkpoint restarted child\n"
checkpoint("Context2",pid)
print "# Restart^2\n"
pid = restart "Context2"
print "# Checkpoint self\n"
checkpoint("Context3",$$)
waitpid pid
print "16 DONE\n"
exit 0' 2>&1
exec 2>&1
sleep 3
echo "# Restart interpreter"
$cr_restart Context3
__EOF__
\rm -f Context[123] .Context[123].tmp 2>/dev/null
|