Commit 1ac470c0 by Daniel Lezcano

add some traces in the code for the logger

Add some traces in the code, so we are able to follow the execution of the start command with the logger. Signed-off-by: 's avatarDaniel Lezcano <dlezcano@fr.ibm.com>
parent f5d18611
......@@ -74,6 +74,8 @@ static int get_cgroup_mount(const char *mtab, char *mnt)
}
};
DEBUG("using cgroup mounted at '%s'", mnt);
fclose(file);
out:
return err;
......@@ -108,6 +110,9 @@ int lxc_rename_nsgroup(const char *name, pid_t pid)
ret = rename(oldname, newname);
if (ret)
SYSERROR("failed to rename cgroup %s->%s", oldname, newname);
else
DEBUG("'%s' renamed to '%s'", oldname, newname);
return ret;
}
......@@ -130,6 +135,9 @@ int lxc_link_nsgroup(const char *name)
ret = symlink(nsgroup, lxc);
if (ret)
SYSERROR("failed to create symlink %s->%s", nsgroup, lxc);
else
DEBUG("'%s' linked to '%s'", nsgroup, lxc);
return ret;
}
......@@ -147,6 +155,8 @@ int lxc_unlink_nsgroup(const char *name)
rmdir(path);
}
DEBUG("unlinking '%s'", nsgroup);
return unlink(nsgroup);
}
......
......@@ -1779,6 +1779,9 @@ int lxc_create_tty(const char *name, struct lxc_tty_info *tty_info)
}
ret = 0;
INFO("tty's configured");
out:
return ret;
......
......@@ -136,6 +136,8 @@ static int setup_sigchld_fd(sigset_t *oldmask)
return -1;
}
DEBUG("sigchild handler set");
return fd;
}
......@@ -166,6 +168,8 @@ static int setup_tty_service(const char *name, int *ttyfd)
static int sigchld_handler(int fd, void *data,
struct lxc_epoll_descr *descr)
{
DEBUG("child exited");
return 1;
}
......@@ -381,6 +385,9 @@ static int console_init(char *console, size_t size)
}
console[0] = '\0';
DEBUG("console initialized");
return 0;
}
......@@ -428,6 +435,9 @@ struct lxc_handler *lxc_init(const char *name)
LXC_TTY_ADD_HANDLER(SIGQUIT);
out:
if (handler)
INFO("'%s' is initialized", name);
return handler;
out_delete_tty:
......@@ -517,6 +527,8 @@ static int do_start(void *arg)
goto out_child;
}
NOTICE("exec'ing '%s'", argv[0]);
execvp(argv[0], argv);
SYSERROR("failed to exec %s", argv[0]);
......@@ -601,6 +613,8 @@ int lxc_spawn(const char *name, struct lxc_handler *handler, char *const argv[])
err = 0;
NOTICE("'%s' started with pid '%d'", argv[0], handler->pid);
out_close:
close(sv[0]);
close(sv[1]);
......
......@@ -93,6 +93,8 @@ int lxc_setstate(const char *name, lxc_state_t state)
}
err = 0;
DEBUG("set state to '%s'", str);
out:
close(fd);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment