mirror of
https://git.proxmox.com/git/mirror_lxc
synced 2025-07-13 12:58:44 +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__);
|
fprintf(stderr, "%d: failed to get extra ref to container\n", __LINE__);
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
c->want_daemonize(c, false);
|
|
||||||
pid_t pid = fork();
|
c->want_daemonize(c, true);
|
||||||
if (pid < 0) {
|
if (!c->startl(c, 0, NULL)) {
|
||||||
fprintf(stderr, "%d: fork failed\n", __LINE__);
|
fprintf(stderr, "%d: %s failed to start\n", __LINE__, c->name);
|
||||||
goto out;
|
exit(1);
|
||||||
}
|
|
||||||
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);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
sleep(3);
|
sleep(3);
|
||||||
|
Loading…
Reference in New Issue
Block a user