aboutsummaryrefslogtreecommitdiff
path: root/plugins-scripts/check_disk_smb.pl
diff options
context:
space:
mode:
authorGravatar RincewindsHat <12514511+RincewindsHat@users.noreply.github.com> 2021-12-02 16:42:05 +0100
committerGravatar GitHub <noreply@github.com> 2021-12-02 16:42:05 +0100
commit911e44045d7291f5ede22739fd176ef55dd3de4a (patch)
treecf36b95a4a964b03d6ecf75770ced2cb3a2ac3a9 /plugins-scripts/check_disk_smb.pl
parent8294af907bd8482a86df749f562b7ec09e3faeed (diff)
parented7cdf82a42f16532801ea4f118870ce9a130fcf (diff)
downloadmonitoring-plugins-911e44045d7291f5ede22739fd176ef55dd3de4a.tar.gz
Merge branch 'master' into fix/shellcheck
Diffstat (limited to 'plugins-scripts/check_disk_smb.pl')
-rwxr-xr-xplugins-scripts/check_disk_smb.pl7
1 files changed, 6 insertions, 1 deletions
diff --git a/plugins-scripts/check_disk_smb.pl b/plugins-scripts/check_disk_smb.pl
index 98992268..28c49e84 100755
--- a/plugins-scripts/check_disk_smb.pl
+++ b/plugins-scripts/check_disk_smb.pl
@@ -19,7 +19,7 @@
#
require 5.004;
-use POSIX;
+use POSIX qw(setsid);
use strict;
use Getopt::Long;
use vars qw($opt_P $opt_V $opt_h $opt_H $opt_s $opt_W $opt_u $opt_p $opt_w $opt_c $opt_a $verbose);
@@ -28,6 +28,9 @@ use FindBin;
use lib "$FindBin::Bin";
use utils qw($TIMEOUT %ERRORS &print_revision &support &usage);
+# make us session leader which makes all childs exit if we do
+setsid;
+
sub print_help ();
sub print_usage ();
@@ -175,6 +178,8 @@ my @lines = undef;
# Just in case of problems, let's not hang the monitoring system
$SIG{'ALRM'} = sub {
print "No Answer from Client\n";
+ $SIG{'INT'} = 'IGNORE';
+ kill(-2, $$);
exit $ERRORS{"UNKNOWN"};
};
alarm($TIMEOUT);