[Buildd-tools-devel] Bug#477936: Bug#477936: does not clean up sessions when interrupted
Roger Leigh
rleigh at whinlatter.ukfsn.org
Sun Apr 27 17:27:27 UTC 2008
martin f krafft <madduck at debian.org> writes:
> If an sbuild gets interrupted, the session is not ended as no
> signals are trapped. sbuild should ensure that it cleans up any
> schroot sessions on exit, if it can in any way (as is the case for
> SIGINT).
schroot currently traps SIGINT, SIGTERM, SIGALRM and SIGPIPE:
$SIG{'INT'} = \&shutdown;
$SIG{'TERM'} = \&shutdown;
$SIG{'ALRM'} = \&shutdown;
$SIG{'PIPE'} = \&shutdown;
In the shutdown signal handler, we do purge the current job and end
the schroot session:
if ( $main::current_job ) { # <- if we're currently building
if ($conf::purge_build_directory eq "always") {
print PLOG "Purging $main::chroot_build_dir\n";
my $bdir = strip_chroot_path($main::chroot_build_dir);
run_command("rm -rf '$bdir'", "root", 1, 0); # <- purge build
}
fixup_pkgv( $main::current_job );
end_session(); # <- end schroot session for the current job
close_build_log( $main::current_job, $main::distribution, $main::pkg_status,
$main::pkg_start_time, $main::pkg_end_time,
$main::this_space );
Now, it's possible that we should be trapping additional signals, or
the signals aren't being trapped in some situations, or the handler is
buggy, but I /think/ it should really be cleaning up correctly.
If it's not doing this for you, please could you provide some more
details about what's not working.
BTW, you might want to check out the current GIT repo:
git://git.debian.org/git/buildd-tools/sbuild
Thanks,
Roger
--
.''`. Roger Leigh
: :' : Debian GNU/Linux http://people.debian.org/~rleigh/
`. `' Printing on GNU/Linux? http://gutenprint.sourceforge.net/
`- GPG Public Key: 0x25BFB848 Please GPG sign your mail.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 188 bytes
Desc: not available
Url : http://lists.alioth.debian.org/pipermail/buildd-tools-devel/attachments/20080427/885e071b/attachment.pgp
More information about the Buildd-tools-devel
mailing list