82 kill(child_pid_, SIGTERM);
87 RCLCPP_ERROR(getLogger(),
"Error forking process.");
94 std::size_t exec_file_pos = dbexec_.find_last_of(
"/\\");
95 if (exec_file_pos != std::string::npos)
97 char** argv =
new char*[4];
98 std::size_t exec_length = 1 + dbexec_.length() - exec_file_pos;
99 argv[0] =
new char[1 + exec_length];
100 snprintf(argv[0], exec_length,
"%s", dbexec_.substr(exec_file_pos + 1).c_str());
102 argv[1] =
new char[16];
103 snprintf(argv[1], 15,
"--dbpath");
105 argv[2] =
new char[1024];
106 snprintf(argv[2], 1023,
"%s", dirname.c_str());
110 int code = execv(dbexec_.c_str(), argv);
115 RCLCPP_ERROR_STREAM(getLogger(),
116 "execv() returned " << code <<
", errno=" << errno <<
" string errno = " << strerror(errno));
123 using namespace std::chrono_literals;
124 rclcpp::sleep_for(1s);