From c701e760eddc52329e471c0b33aa17a1b07e4921 Mon Sep 17 00:00:00 2001 From: Damyan Ivanov Date: Thu, 11 Nov 2021 14:46:46 +0000 Subject: [PATCH] dump configuration to STDERR on SIGUSR1 --- bin/mpd-feeder | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/bin/mpd-feeder b/bin/mpd-feeder index da60df8..d6f5d6f 100755 --- a/bin/mpd-feeder +++ b/bin/mpd-feeder @@ -180,6 +180,22 @@ use Net::Async::MPD; }, ) ); + + $mpd->loop->add( + IO::Async::Signal->new( + name => 'USR1', + on_receipt => sub { + $log->debug("SIGUSR1 received. Dumping configuration to STDERR"); + my $old = select \*STDERR; + try { + $opt->dump; + } + finally { + select $old; + } + }, + ) + ); } method connect_db { -- 2.39.5