Slide 51
Slide 51 text
͖ͬ͞ͷ1FSMίϯςφʹύον
--- chroot2.pl 2017-06-20 10:47:02.780313607 +0900
+++ bomber.pl 2017-06-20 12:55:41.572399620 +0900
@@ -2,11 +2,19 @@
use strict;
use POSIX;
use Linux::Clone;
+system "mkdir -p /sys/fs/cgroup/pids/yapc-fukuoka";
my $flg = POSIX::SIGCHLD | Linux::Clone::NEWNS | Linux::Clone::NEWPID;
my $pid = Linux::Clone::clone sub {
system "mount --make-rslave /";
chroot "/var/lib/haconiwa/rootfs/php"; chdir "/";
- exec "/bin/sh"; 127 }, 0, $flg;
+ exec "/bin/bash"; 127 }, 0, $flg;
+open TASKS, ">> /sys/fs/cgroup/pids/yapc-fukuoka/tasks";
+print TASKS "$pid";
+close TASKS;
+open MAX, ">> /sys/fs/cgroup/pids/yapc-fukuoka/pids.max";
+print MAX "32";
+close MAX;
+
print "PID=", $pid, "\n";
waitpid $pid, 0 if($pid);
QJETDHSPVQΛՃ
ίϯςφͷQJEΛॴଐͤ͞ɺ
NBYΛ੍ݶ