Ticket #988 (closed task: wontfix)

Opened 2 years ago

Last modified 4 months ago

Bash in plugins

Reported by: MicRO Assigned to: nobody
Priority: normal Milestone:
Component: plugins Version: 1.4.5
Severity: normal Keywords:
Cc:

Description

5 plugins have @@BASH@@ may be their rewrite to sh? example from freebsd

micro# grep -r "/usr/local/bin/bash" /usr/local/share/munin/plugins/
/usr/local/share/munin/plugins/colour_tester:#!/usr/local/bin/bash
/usr/local/share/munin/plugins/extinfo_tester:#!/usr/local/bin/bash
/usr/local/share/munin/plugins/fail2ban:#!/usr/local/bin/bash
/usr/local/share/munin/plugins/squeezebox_:#!/usr/local/bin/bash
/usr/local/share/munin/plugins/warning_tester:#!/usr/local/bin/bash

micro# ls /usr/local/share/munin/plugins/ | wc -l
     192

for these 5 plugin in makefile

bash:${PORTSDIR}/shells/bash

but i use csh...

what do you think?

Change History

01/07/11 12:46:15 changed by jo

  • owner changed from nobody to jo.

Most shell plugins use sh, but a few (the ones you list) use bash since they use code that's not compatible with a regular posix shell (i.e. sh).

Modifying them to use a posix sh isn't a very high requirement at the moment (and probably never will be), but if anybody wants to rewrite them to only use posix syntax so the can make do with sh instead, and contribute the patches back to us, that would be very welcome. ;-)

01/07/11 12:46:38 changed by jo

  • status changed from new to closed.
  • resolution set to wontfix.

01/07/11 13:37:24 changed by jo

  • status changed from closed to reopened.
  • type changed from enhancement to task.
  • resolution deleted.

01/07/11 13:37:51 changed by jo

  • milestone deleted.

01/07/11 15:39:40 changed by jo

  • owner changed from jo to nobody.
  • status changed from reopened to new.

01/30/12 07:16:14 changed by kenyon

  • status changed from new to closed.
  • resolution set to wontfix.

Three of the five plugins listed in this ticket are for debugging munin, so I think we can ignore those, since they wouldn't be used in a production environment.

The fail2ban plugin gives reasoning for using bash: "Needs bash. Uses bashisms ${parm/?/pat/string} and $'...' to avoid running external programs." source:trunk/plugins/node.d/fail2ban.in@4612#L44

The squeezebox plugin looks like it could be done with plain sh, but not worth the effort if nobody wants it. If anyone wants a specific plugin rewritten in plain sh, please open new tickets for the particular plugins, with patches attached. Thanks.