if (do_mkdirp) {
ret = snprintf(fifo_path, fifo_path_sz, "%s/lxc/%s", rundir, lxcpath);
if (ret < 0 || (size_t)ret >= fifo_path_sz) {
- ERROR("rundir/lxcpath (%s/%s) too long for monitor fifo.", rundir, lxcpath);
+ ERROR("rundir/lxcpath (%s/%s) too long for monitor fifo", rundir, lxcpath);
free(rundir);
return -1;
}
}
ret = snprintf(fifo_path, fifo_path_sz, "%s/lxc/%s/monitor-fifo", rundir, lxcpath);
if (ret < 0 || (size_t)ret >= fifo_path_sz) {
- ERROR("rundir/lxcpath (%s/%s) too long for monitor fifo.", rundir, lxcpath);
+ ERROR("rundir/lxcpath (%s/%s) too long for monitor fifo", rundir, lxcpath);
free(rundir);
return -1;
}
ret = lxc_write_nointr(fd, msg, sizeof(*msg));
if (ret != sizeof(*msg)) {
close(fd);
- SYSERROR("Failed to write to monitor fifo \"%s\".", fifo_path);
+ SYSERROR("Failed to write to monitor fifo \"%s\"", fifo_path);
return;
}
path = alloca(len);
ret = snprintf(path, len, "lxc/%s/monitor-sock", lxcpath);
if (ret < 0 || (size_t)ret >= len) {
- ERROR("failed to create name for monitor socket");
+ ERROR("Failed to create name for monitor socket");
return -1;
}
hash = fnv_64a_buf(path, ret, FNV1A_64_INIT);
ret = snprintf(addr->sun_path, len, "@lxc/%016" PRIx64 "/%s", hash, lxcpath);
if (ret < 0) {
- ERROR("failed to create hashed name for monitor socket");
+ ERROR("Failed to create hashed name for monitor socket");
return -1;
}
/* replace @ with \0 */
addr->sun_path[0] = '\0';
- INFO("using monitor socket name \"%s\" (length of socket name %zu must be <= %zu)", &addr->sun_path[1], strlen(&addr->sun_path[1]), sizeof(addr->sun_path) - 3);
+ INFO("Using monitor socket name \"%s\" (length of socket name %zu must be <= %zu)", &addr->sun_path[1], strlen(&addr->sun_path[1]), sizeof(addr->sun_path) - 3);
return 0;
}
return -1;
len = strlen(&addr.sun_path[1]);
- DEBUG("opening monitor socket %s with len %zu", &addr.sun_path[1], len);
+ DEBUG("Opening monitor socket %s with len %zu", &addr.sun_path[1], len);
if (len >= sizeof(addr.sun_path) - 1) {
errno = ENAMETOOLONG;
SYSERROR("The name of monitor socket too long (%zu bytes)", len);
}
}
- SYSERROR("No ready fd found.");
+ SYSERROR("No ready fd found");
return -1;
}
/* double fork to avoid zombies when monitord exits */
pid1 = fork();
if (pid1 < 0) {
- SYSERROR("Failed to fork().");
+ SYSERROR("Failed to fork()");
return -1;
}
if (pid1) {
- DEBUG("Going to wait for pid %d.", pid1);
+ DEBUG("Going to wait for pid %d", pid1);
if (waitpid(pid1, NULL, 0) != pid1)
return -1;
- DEBUG("Finished waiting on pid %d.", pid1);
+ DEBUG("Finished waiting on pid %d", pid1);
return 0;
}
if (pipe(pipefd) < 0) {
- SYSERROR("Failed to create pipe.");
+ SYSERROR("Failed to create pipe");
_exit(EXIT_FAILURE);
}
pid2 = fork();
if (pid2 < 0) {
- SYSERROR("Failed to fork().");
+ SYSERROR("Failed to fork()");
_exit(EXIT_FAILURE);
}
if (pid2) {
- DEBUG("Trying to sync with child process.");
+ DEBUG("Trying to sync with child process");
char c;
/* Wait for daemon to create socket. */
close(pipefd[1]);
close(pipefd[0]);
- DEBUG("Successfully synced with child process.");
+ DEBUG("Successfully synced with child process");
_exit(EXIT_SUCCESS);
}
if (setsid() < 0) {
- SYSERROR("Failed to setsid().");
+ SYSERROR("Failed to setsid()");
_exit(EXIT_FAILURE);
}
lxc_check_inherited(NULL, true, &pipefd[1], 1);
if (null_stdfds() < 0) {
- SYSERROR("Failed to dup2() standard file descriptors to /dev/null.");
+ SYSERROR("Failed to dup2() standard file descriptors to /dev/null");
_exit(EXIT_FAILURE);
}
ret = snprintf(pipefd_str, sizeof(pipefd_str), "%d", pipefd[1]);
if (ret < 0 || ret >= sizeof(pipefd_str)) {
- ERROR("Failed to create pid argument to pass to monitord.");
+ ERROR("Failed to create pid argument to pass to monitord");
_exit(EXIT_FAILURE);
}
- DEBUG("Using pipe file descriptor %d for monitord.", pipefd[1]);
+ DEBUG("Using pipe file descriptor %d for monitord", pipefd[1]);
execvp(args[0], args);
- SYSERROR("failed to exec lxc-monitord");
+ SYSERROR("Failed to exec lxc-monitord");
_exit(EXIT_FAILURE);
}