freebsdjail

Freebsd jail command execution error with no reason


I try to execute command:

# service jail start myjail

I debug the /etc/rc.d/jail and dump that really command is:

/usr/sbin/jail -l -U root -i -f /var/run/jail.myjail.conf -c myjail

The output is:

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 ...

The file /var/run/jail.myjail.conf is autogenrated by rc jail script based on variables of previously worked jail from rc.conf

The content is:

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;
}

What is wrong?


Solution

  • The problem solved by replace old style configuration variables in rc.conf by one line:

    jail_myjail_conf="/var/run/jail.myjail.conf"