#include <sys/mount.h>
 #define _GNU_SOURCE
 #include <getopt.h>
-#include "log.h"
-#include "error.h"
+#include "lxc.h"
 
 lxc_log_define(lxc_init, lxc);
 
                return -1;
        }
 
+       DEBUG("'%s' mounted on '%s'", source, target);
+
        return 0;
 }
 
 {
        if (mount_fs("proc", "/proc", "proc"))
                return -1;
+
        if (mount_fs("shmfs", "/dev/shm", "tmpfs"))
                return -1;
 
                if (setup_fs())
                        exit(err);
 
+               NOTICE("about to exec '%s'", aargv[0]);
+
                execvp(aargv[0], aargv);
                ERROR("failed to exec: '%s' : %s", aargv[0], strerror(errno));
                exit(err);
        }
 
+       err = lxc_close_all_inherited_fd();
+       if (err) {
+               ERROR("unable to close inherited fds");
+               goto out;
+       }
+
        err = 0;
        for (;;) {
                int status;