我尝试执行命令:
# service jail start myjail
我调试 /etc/rc.d/jail 并转储真正的命令是:
/usr/sbin/jail -l -U root -i -f /var/run/jail.myjail.conf -c myjail
输出是:
usage: jail [-dhilqv] [-J jid_file] [-u username] [-U username] -[cmr] param=value ... [command=command ...] jail [-dqv] [-f file] -[cmr] [jail] jail [-qv] [-f file] -[rR] ['*' | jail ...] jail [-dhilqv] [-J jid_file] [-u username] [-U username] [-n jailname] [-s securelevel] path hostname [ip[,...]] command ...
文件 /var/run/jail.myjail.conf 由 rc jail 脚本根据 rc.conf 中先前工作的监狱的变量自动生成
内容是:
myjail {
host.hostname = "myjail.example.com";
path = "/var/jail/myjail.root";
ip4.addr += "192.168.0.150/32";
allow.raw_sockets = 0;
exec.clean;
exec.system_user = "root";
exec.jail_user = "root";
exec.start += "/bin/sh /etc/rc";
exec.stop = "/bin/sh /etc/rc.shutdown";
exec.consolelog = "/var/log/jail_myjail_console.log";
mount.devfs;
allow.set_hostname = 0;
allow.sysvipc = 0;
}
怎么了?