Пример #1
0
events::Event
FileSystemEvents::up_and_running(const std::string& mntpoint)
{
    events::Event ev;
    auto msg = ev.MutableExtension(events::up_and_running);

    msg->set_mountpoint(mntpoint);

    return ev;
}
Пример #2
0
void process_arguments(int argc, char **argv)
{
	struct zfs_opts zopts;

	main_args = (struct fuse_args)FUSE_ARGS_INIT(argc, argv);
	memset(&zopts, 0, sizeof(zopts));
	if (fuse_opt_parse
		(&main_args, &zopts, main_options, handle_one_argument) != 0)
	{
		usage();
		exit(EXIT_FAILURE);
	}

	if (zopts.config)
	{
		set_local_config_path(zopts.config);
	}

	set_log_level(&syplogger, zopts.loglevel);


	// start zfsd on background or foreground
	int foreground;
	int rv;
	char * mountpoint;
	rv = fuse_parse_cmdline(&main_args, &mountpoint, NULL, &foreground);
	if (rv == -1)
	{
		message(LOG_INFO, FACILITY_ZFSD, "Failed to parse fuse cmdline options.\n");
		exit(EXIT_FAILURE);
	}

	set_mountpoint(mountpoint);
	free(mountpoint);

#ifndef ENABLE_CLI_CONSOLE //cli use console, don't daemonize
	rv = fuse_daemonize(foreground);
	if (rv == -1)
	{
		message(LOG_INFO, FACILITY_ZFSD, "Failed to daemonize zfsd.\n");
		exit(EXIT_FAILURE);
	}
#endif

}