diff options
author | jamie <jamie@FreeBSD.org> | 2011-07-06 21:49:56 +0000 |
---|---|---|
committer | jamie <jamie@FreeBSD.org> | 2011-07-06 21:49:56 +0000 |
commit | c64e6444df8299e419d7eb6cbc79915e1d7441af (patch) | |
tree | 7943d004d519dd0a3e326beb7017909e33431a4b /usr.sbin/jail | |
parent | 416d58f50fc60475c5aa1691108b5280a7296d47 (diff) | |
download | FreeBSD-src-c64e6444df8299e419d7eb6cbc79915e1d7441af.zip FreeBSD-src-c64e6444df8299e419d7eb6cbc79915e1d7441af.tar.gz |
Don't report errors for the exit status of processes that are killed
as part of jail removal (IP_STOP_TIMEOUT).
Note a jail as "removed" even if it wasn't jail_remove() that did
the deed, e.g. if it already went away because all its processes
were killed.
Diffstat (limited to 'usr.sbin/jail')
-rw-r--r-- | usr.sbin/jail/command.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/usr.sbin/jail/command.c b/usr.sbin/jail/command.c index d0ea865..774cac3 100644 --- a/usr.sbin/jail/command.c +++ b/usr.sbin/jail/command.c @@ -150,11 +150,15 @@ finish_command(struct cfjail *j) if (!(j->flags & JF_SLEEPQ)) return 0; j->flags &= ~JF_SLEEPQ; - if (*j->comparam != IP_STOP_TIMEOUT) { - paralimit++; - if (!TAILQ_EMPTY(&runnable)) - requeue(TAILQ_FIRST(&runnable), &ready); + if (*j->comparam == IP_STOP_TIMEOUT) + { + j->flags &= ~JF_TIMEOUT; + j->pstatus = 0; + return 0; } + paralimit++; + if (!TAILQ_EMPTY(&runnable)) + requeue(TAILQ_FIRST(&runnable), &ready); error = 0; if (j->flags & JF_TIMEOUT) { j->flags &= ~JF_TIMEOUT; @@ -270,8 +274,8 @@ run_command(struct cfjail *j) case IP__OP: if (down) { - if (jail_remove(j->jid) == 0 && verbose >= 0 && - (verbose > 0 || (j->flags & JF_STOP + (void)jail_remove(j->jid); + if (verbose > 0 || (verbose == 0 && (j->flags & JF_STOP ? note_remove : j->name != NULL))) jail_note(j, "removed\n"); j->jid = -1; |