def run_container(cli, config): if not getattr(cli, "no_init", False): init_container(cli, config) else: paths.ensure_samba_dirs() if cli.target == "smbd": # execute smbd process cmd = [ "/usr/sbin/smbd", "--foreground", "--log-stdout", "--no-process-group", ] os.execvp(cmd[0], cmd) elif cli.target == "winbindd": if getattr(cli, "insecure_auto_join", False): join(cli, config) # execute winbind process cmd = [ "/usr/sbin/winbindd", "--foreground", "--stdout", "--no-process-group", ] os.execvp(cmd[0], cmd) else: raise Fail(f"invalid target process: {cli.target}")
def import_config(cli, config): # there are some expectations about what dirs exist and perms paths.ensure_samba_dirs() cfgs = cli.config or [] iconfig = config.read_config_files(cfgs).get(cli.identity) loader = nc.NetCmdLoader() loader.import_config(iconfig)
def import_config(ctx: Context) -> None: """Import configuration parameters from the sambacc config to samba's registry config. """ # there are some expectations about what dirs exist and perms paths.ensure_samba_dirs() loader = nc.NetCmdLoader() loader.import_config(ctx.instance_config)
def import_config(cli, config) -> None: """Import configuration parameters from the sambacc config to samba's registry config. """ # there are some expectations about what dirs exist and perms paths.ensure_samba_dirs() cfgs = cli.config or [] iconfig = config.read_config_files(cfgs).get(cli.identity) loader = nc.NetCmdLoader() loader.import_config(iconfig)
def run_container(cli, config): """Run a specified server process.""" if not getattr(cli, "no_init", False): init_container(cli, config) else: paths.ensure_samba_dirs() if cli.target == "smbd": # execute smbd process samba_cmds.execute(samba_cmds.smbd_foreground) elif cli.target == "winbindd": if getattr(cli, "insecure_auto_join", False): join(cli, config) # execute winbind process samba_cmds.execute(samba_cmds.winbindd_foreground) else: raise Fail(f"invalid target process: {cli.target}")