mirror of
https://git.proxmox.com/git/mirror_lxc
synced 2025-07-12 23:41:27 +00:00
tests: daemonize in startone
This should finally silence this test for good :) Signed-off-by: Stéphane Graber <stgraber@ubuntu.com> Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
This commit is contained in:
parent
e9c5dc7ba3
commit
4fd0838c69
@ -163,24 +163,11 @@ int main(int argc, char *argv[])
|
||||
fprintf(stderr, "%d: failed to get extra ref to container\n", __LINE__);
|
||||
exit(1);
|
||||
}
|
||||
c->want_daemonize(c, false);
|
||||
pid_t pid = fork();
|
||||
if (pid < 0) {
|
||||
fprintf(stderr, "%d: fork failed\n", __LINE__);
|
||||
goto out;
|
||||
}
|
||||
if (pid == 0) {
|
||||
close(0);
|
||||
close(1);
|
||||
close(2);
|
||||
open("/dev/zero", O_RDONLY);
|
||||
open("/dev/null", O_RDWR);
|
||||
open("/dev/null", O_RDWR);
|
||||
b = c->startl(c, 0, NULL);
|
||||
if (!b)
|
||||
fprintf(stderr, "%d: %s failed to start\n", __LINE__, c->name);
|
||||
lxc_container_put(c);
|
||||
exit(!b);
|
||||
|
||||
c->want_daemonize(c, true);
|
||||
if (!c->startl(c, 0, NULL)) {
|
||||
fprintf(stderr, "%d: %s failed to start\n", __LINE__, c->name);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
sleep(3);
|
||||
|
Loading…
Reference in New Issue
Block a user