nonnoroger wrote:
> Well no - any *nix uses the SIGQUIT signal to cause a "core" dump. It
> was often generated interactively buy a developer typing ctrl-\ at the
> foreground process to get a dump for debugging.
>
> SIGINT is the signal that can be generated by ctrl-C at the keyboard and
> normally causes a clean termination of a process - but it can be
> "caught" by the receiving process to let it do some cleaning up before
> exiting.
>
> I turned logging to DEBUG for spotifyd and stopped LMS again. Nothing in
> the spotify log, but the server log said:
>
> [12-08-22 10:42:35.7588] Plugins::Spotify::Spotifyd::shutdownD (158)
> killing spotifyd
>
> In your SpotifyD.pm you have:
>
> sub shutdownD {
> my $class = shift;
>
> if ($spotifydChecker) {
> Slim::Utils::Timers::killSpecific($spotifydChecker);
> $spotifydChecker = undef;
> }
>
> if ($spotifyd && $spotifyd->alive) {
>
> $log->info("killing spotifyd");
> $spotifyd->die;
> }
> }
>
> Which presumably generated the log message. What is the effect of
> $spotifyd->die;?
Well this is a feature of CPAN's Proc::Background then which is used to
start background processes for the server - this has the following code
in it:
sub _die {
my $self = shift;
# Try to kill the process with different signals. Calling alive()
will
# collect the exit status of the program.
SIGNAL: {
foreach my $signal (qw(HUP QUIT INT KILL)) {
my $count = 5;
while ($count and $self->alive) {
--$count;
kill($signal, $self->{_os_obj});
last SIGNAL unless $self->alive;
sleep 1;
}
}
}
}
This is part of the server distribution, all I am doing is using that
module. I do trap HUP in spotifyd so that the process does not end if
the terminal session which started it ends, which seems reasonable.
However the use of QUIT to kill something before trying INT is contary
to what you are saying... I've just checked the latest version of that
module on CPAN and that code remains the same.
------------------------------------------------------------------------
Triode's Profile: http://forums.slimdevices.com/member.php?userid=17
View this thread: http://forums.slimdevices.com/showthread.php?t=79706
_______________________________________________
plugins mailing list
[email protected]
http://lists.slimdevices.com/mailman/listinfo/plugins