IF YOU WOULD LIKE TO GET AN ACCOUNT, please write an email to s dot adaszewski at gmail dot com. User accounts are meant only to report issues and/or generate pull requests. This is a purpose-specific Git hosting for ADARED projects. Thank you for your understanding!
浏览代码

Added hostname in jail

tags/0.92
父节点
当前提交
3d8798d698
共有 1 个文件被更改,包括 5 次插入4 次删除
  1. +5
    -4
      jail.py

+ 5
- 4
jail.py 查看文件

@@ -17,7 +17,7 @@ def gen_env_command(command, env):
return command
def jail_create(path, command, env, mounts):
def jail_create(path, command, env, mounts, hostname):
name = os.path.split(path)[-1]
if os.path.exists('/etc/jail.conf'):
conf = jailconf.load('/etc/jail.conf')
@@ -50,6 +50,7 @@ def jail_create(path, command, env, mounts):
blk['ip4.addr'] = '127.0.1.0'
blk['mount.devfs'] = True
blk['exec.clean'] = True
blk['host.hostname'] = hostname or name
conf.write('/etc/jail.conf')
@@ -150,9 +151,9 @@ def command_jail_create(args):
name = poolname + '/focker/jails/' + sha256[:pre]
if not zfs_exists(name):
break
zfs_run(['zfs', 'clone', '-o', 'focker:sha256=' + sha256] + \
(['-o', 'focker:tags=' + ' '.join(args.tags)] if args.tags else []) + \
[image, name])
zfs_run(['zfs', 'clone', '-o', 'focker:sha256=' + sha256, image, name])
if args.tags:
zfs_tag(name, args.tags)
path = zfs_mountpoint(name)
jail_create(path, args.command,
{ a.split(':')[0]: ':'.join(a.split(':')[1:]) \


正在加载...
取消
保存