Skip to content

Commit e4cd049

Browse files
committed
Fix trivial instances of wrong autoconf exitcodes
1 parent 99f6979 commit e4cd049

File tree

152 files changed

+225
-344
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

152 files changed

+225
-344
lines changed

plugins/accounting/accounting_

+5-7
Original file line numberDiff line numberDiff line change
@@ -116,17 +116,15 @@ fi
116116
if [ "$1" == "autoconf" ]; then
117117
if [ -r /proc/net/dev ]; then
118118
$IPTABLES -L INPUT -v -n -x -w >/dev/null 2>/dev/null
119-
if [ $? -gt 0 ]; then
120-
echo "no (could not run iptables as user `whoami`)"
121-
exit 1
122-
else
123-
echo yes
124-
exit 0
119+
if [ $? -gt 0 ]; then
120+
echo "no (could not run iptables as user `whoami`)"
121+
else
122+
echo yes
125123
fi
126124
else
127125
echo "no (/proc/net/dev not found)"
128-
exit 1
129126
fi
127+
exit 0
130128
fi
131129

132130
if [ "$1" = "suggest" ]; then

plugins/amavis/amavis-debian

+1-2
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,10 @@ mktempfile () {
3737
if [ "$1" = "autoconf" ]; then
3838
if [ -f "${AMAVIS_LOG}" -a -n "${LOGTAIL}" -a -x "${LOGTAIL}" -a -n "${BC}" -a -x "${BC}" ] ; then
3939
echo yes
40-
exit 0
4140
else
4241
echo no
43-
exit 1
4442
fi
43+
exit 0
4544
fi
4645

4746
if [ "$1" = "config" ]; then

plugins/amavis/amavis_

+1-2
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,10 @@ my($db_home) = # DB databases directory
4545
if ($ARGV[0] and $ARGV[0] eq "autoconf") {
4646
if (-x "/usr/sbin/amavisd-agent") {
4747
print "yes\n";
48-
exit 0;
4948
} else {
5049
print "no (/usr/sbin/amavisd-agent not found or not executable)\n";
51-
exit 1;
5250
}
51+
exit 0;
5352
} elsif ($ARGV[0] and $ARGV[0] eq "suggest") {
5453
print "time\n";
5554
print "cache\n";

plugins/amavis/amavis_awk

+1-2
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,10 @@ STATEFILE=$MUNIN_PLUGSTATE/amavis.offset
2323
if [ "$1" = "autoconf" ]; then
2424
if [ -f "${MAIL_LOG}" -a -n "${LOGTAIL}" -a -x "${LOGTAIL}" ] ; then
2525
echo yes
26-
exit 0
2726
else
2827
echo no
29-
exit 1
3028
fi
29+
exit 0
3130
fi
3231

3332
if [ "$1" = "config" ]; then

plugins/amr/amr

+1-2
Original file line numberDiff line numberDiff line change
@@ -54,14 +54,13 @@ sub autoconf
5454
if (-d $LOGDIR) {
5555
if (-f $logfile) {
5656
print "yes\n";
57-
exit 0;
5857
} else {
5958
print "no (logfile not found)\n";
6059
}
6160
} else {
6261
print "no (could not find logdir)\n";
6362
}
64-
exit 1;
63+
exit 0;
6564
}
6665

6766
sub config

plugins/apache/apache_activity

+2-2
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ my %chars = (
4242
if (exists $ARGV[0] and $ARGV[0] eq "autoconf") {
4343
if ($ret) {
4444
print "no ($ret)\n";
45-
exit 1;
45+
exit 0;
4646
}
4747
my $ua = LWP::UserAgent->new(timeout => 30);
4848
my @badports;
@@ -55,7 +55,7 @@ if (exists $ARGV[0] and $ARGV[0] eq "autoconf") {
5555

5656
if (@badports) {
5757
print "no (no apache server-status on ports @badports)\n";
58-
exit 1;
58+
exit 0;
5959
} else {
6060
print "yes\n";
6161
exit 0;

plugins/apache/apache_users

+1-4
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,13 @@ then
2323
if ! ls $ACCESSLOG > /dev/null
2424
then
2525
echo "no (could not find apache access log \"$ACCESSLOG\")"
26-
exit 1
2726
elif ! ls $DIRECTORY > /dev/null
2827
then
2928
echo "no (could not find munin plugins directory \"$DIRECTORY\")"
30-
exit 2
31-
3229
else
3330
echo "yes"
34-
exit 0
3531
fi
32+
exit 0
3633
fi
3734

3835
# ######################################################################################### INIT

plugins/apache/apache_watch_

+2-2
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ my $type = "throughput";
3939
if (exists $ARGV[0] and $ARGV[0] eq "autoconf") {
4040
if ($ret) {
4141
print "no ($ret)\n";
42-
exit 1;
42+
exit 0;
4343
}
4444
my $ua = LWP::UserAgent->new (timeout => 30);
4545
my @badports;
@@ -52,7 +52,7 @@ if (exists $ARGV[0] and $ARGV[0] eq "autoconf") {
5252

5353
if (@badports) {
5454
print "no (no mod_watch exists on ports @badports)\n";
55-
exit 1;
55+
exit 0;
5656
} else {
5757
print "yes\n";
5858
exit 0;

plugins/asterisk/asterisk_inuse

+1-3
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,13 @@ if [ "$1" = "autoconf" ]; then
1111
asterisk -rx 'sip show inuse' > /dev/null
1212
if [ $? = "0" ]; then
1313
echo yes
14-
exit 0
1514
else
1615
echo no
17-
exit 1
1816
fi
1917
else
2018
echo no
21-
exit 1
2219
fi
20+
exit 0
2321
fi
2422

2523
if [ "$1" = "config" ]; then

plugins/battery/acpi-battery

+1-2
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,10 @@
3232
if [ "$1" = "autoconf" ]; then
3333
if grep -q 'present.*yes' /proc/acpi/battery/*/info > /dev/null 2>&1; then
3434
echo yes
35-
exit 0
3635
else
3736
echo "no (battery not detected)"
38-
exit 1
3937
fi
38+
exit 0
4039
fi
4140

4241
cd /proc/acpi/battery

plugins/bigbrother/b3error_

+1-2
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ mktempfile () {
2929
if [ "$1" = "autoconf" ]; then
3030
if [ -n "${B3NAME}" -a -f "${logfile}" -a -n "${LOGTAIL}" -a -x "${LOGTAIL}" ]; then
3131
echo yes
32-
exit 0
3332
else
3433
echo -n "no"
3534
if [ ! -n "${B3NAME}" ]; then
@@ -43,8 +42,8 @@ if [ "$1" = "autoconf" ]; then
4342
elif [ ! -x "${LOGTAIL}" ]; then
4443
echo " (cannot execute ${LOGTAIL})"
4544
fi
46-
exit 1
4745
fi
46+
exit 0
4847
fi
4948

5049
if [ "$1" = "config" ]; then

plugins/bind/bind_

+2-2
Original file line numberDiff line numberDiff line change
@@ -98,11 +98,11 @@ if ( defined($ARGV[0]) && $ARGV[0] eq "config" ) {
9898
if ( defined($ARGV[0]) && $ARGV[0] eq "autoconf" ) {
9999
if (! -f $stat_file) {
100100
printf "Unable to file bind stat file on %s",$stat_file;
101-
exit 1;
101+
exit 0;
102102
}
103103
if (! -f $rndc) {
104104
printf "Unable to file rndc tool (configured : %s)",$rndc;
105-
exit 1;
105+
exit 0;
106106
}
107107
exit 0;
108108
}

plugins/bird/bird

+1-2
Original file line numberDiff line numberDiff line change
@@ -111,11 +111,10 @@ sub get_stats {
111111
sub autoconf {
112112
if (-S $socket) {
113113
say 'yes';
114-
exit 0;
115114
} else {
116115
say 'no';
117-
exit 1;
118116
}
117+
exit 0;
119118
}
120119

121120
sub config {

plugins/boinc/boinc_processes

+1-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ sub autoconf {
6363
}
6464
}
6565
print "no\n";
66-
exit 1;
66+
exit 0;
6767
}
6868

6969
sub config {

plugins/condor/condor_activity_

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ fi
5252

5353
if [ "$1" = "autoconf" ]; then
5454
echo "no"
55-
exit 1
55+
exit 0
5656
fi
5757

5858
if [ "$1" = "suggest" ]; then

plugins/condor/condor_ops_

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ fi
5353

5454
if [ "$1" = "autoconf" ]; then
5555
echo "no"
56-
exit 1
56+
exit 0
5757
fi
5858

5959
if [ "$1" = "suggest" ]; then

plugins/condor/condor_queue_

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ fi
5555

5656
if [ "$1" = "autoconf" ]; then
5757
echo "no"
58-
exit 1
58+
exit 0
5959
fi
6060

6161
if [ "$1" = "suggest" ]; then

plugins/condor/condor_states_

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ fi
5252

5353
if [ "$1" = "autoconf" ]; then
5454
echo "no"
55-
exit 1
55+
exit 0
5656
fi
5757

5858
if [ "$1" = "suggest" ]; then

plugins/disk/du

+1-2
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,10 @@ ID=1;
5858
if [ "$1" = "autoconf" ]; then
5959
if [ -d $DIR ]; then
6060
echo "yes"
61-
exit 0
6261
else
6362
echo "no (check your path)"
64-
exit 1
6563
fi
64+
exit 0
6665
fi
6766

6867
if [ "$1" = "config" ]; then

plugins/disk/e2

+1-2
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,10 @@ lse2() {
5757
if [ "$1" = "autoconf" ]; then
5858
if which dumpe2fs >/dev/null 2>&1; then
5959
echo yes
60-
exit 0
6160
else
6261
echo no
63-
exit 1
6462
fi
63+
exit 0
6564
fi
6665
if [ "$1" = "suggest" ]; then
6766
lse2 | while read name rest; do

plugins/disk/hpasmcli2_

+1-3
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ if (defined($ARGV[0])) {
6060
my @chk_result = `$hpasmcli -s \"help\"`;
6161
if ($? eq "0") {
6262
print "yes\n";
63-
exit 0;
6463
} else {
6564
my $reason = 'Unknown error';
6665
foreach my $line (@chk_result) {
@@ -71,12 +70,11 @@ if (defined($ARGV[0])) {
7170
}
7271
}
7372
print "no ($reason)\n";
74-
exit 1;
7573
}
7674
} else {
7775
print "no (hpasmcli not found)\n";
78-
exit 1;
7976
}
77+
exit 0;
8078
} elsif ($ARGV[0] eq 'suggest') {
8179
print "temp\nfans\n";
8280
exit 0;

plugins/disk/linux_diskstat_

+1-2
Original file line numberDiff line numberDiff line change
@@ -147,12 +147,11 @@ if ( defined $ARGV[0] && $ARGV[0] eq 'autoconf' ) {
147147
if ( !$@ && keys %stats ) {
148148

149149
print "yes\n";
150-
exit 0;
151150
}
152151
else {
153152
print "no\n";
154-
exit 1;
155153
}
154+
exit 0;
156155
}
157156

158157

plugins/disk/md_iostat_

+3-3
Original file line numberDiff line numberDiff line change
@@ -96,10 +96,10 @@ $mdstat_present = -f '/proc/mdstat';
9696
if ( defined($ARGV[0]) and $ARGV[0] eq "autoconf") {
9797
if ($mdstat_present and ($detailed_present or $stat_present)) {
9898
print "yes\n";
99-
exit 0;
99+
} else {
100+
print "no\n";
100101
}
101-
print "no\n";
102-
exit 1;
102+
exit 0;
103103
}
104104

105105
my %devs;

plugins/disk/megaraid-controller-information

+1-2
Original file line numberDiff line numberDiff line change
@@ -126,11 +126,10 @@ my %config = (
126126
if ($ARGV[0] and $ARGV[0] eq "autoconf" ) {
127127
if (-e $Command ) {
128128
print "yes\n";
129-
exit 0;
130129
} else {
131130
print "no\n";
132-
exit 1
133131
}
132+
exit 0;
134133
}
135134

136135
#Read Output of MegaRaid command

plugins/disk/raid-mismatch-count

+1-3
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,12 @@ returnval=$?
3030
if [ "x$1" = "xautoconf" ]; then
3131
if [ -z "$targets" ]; then
3232
echo "no (no md devices found under /sys/devices/virtual/block/*/md/mismatch_cnt)"
33-
exit 1;
3433
elif [ "x$returnval" != "x0" ]; then
3534
echo "no (discovery of md devices failed strangely)"
36-
exit 1;
3735
else
3836
echo "yes"
39-
exit 0
4037
fi
38+
exit 0
4139
fi
4240

4341
if [ "x$1" = "xconfig" ]; then

plugins/dkim/dkimproxy_mails

+1-2
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,10 @@ STATEFILE=$MUNIN_PLUGSTATE/dkimproxy_mails.offset
3737
if [ "$1" = "autoconf" ]; then
3838
if [ -f "${MAIL_LOG}" -a -n "${LOGTAIL}" -a -x "${LOGTAIL}" ] ; then
3939
echo yes
40-
exit 0
4140
else
4241
echo no
43-
exit 1
4442
fi
43+
exit 0
4544
fi
4645

4746
if [ "$1" = "config" ]; then

plugins/dovecot/dovecot1

+3-3
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,12 @@ if ( $ARGV[0] and $ARGV[0] eq "autoconf" ) {
3636

3737
if (! -x $DOVEADM) {
3838
print "no (no doveadm)\n";
39-
exit(1);
39+
exit(0);
4040
}
4141

4242
if (! -f $logfile) {
4343
print "no (logfile $logfile does not exist)\n";
44-
exit(1);
44+
exit(0);
4545
}
4646

4747
if (-r "$logfile") {
@@ -50,7 +50,7 @@ if ( $ARGV[0] and $ARGV[0] eq "autoconf" ) {
5050
} else {
5151
print "no (logfile not readable)\n";
5252
}
53-
exit 1;
53+
exit 0;
5454
}
5555

5656
if (-f "$logfile.0") {

0 commit comments

Comments
 (0)