/etc/profile.d/juju-introspection.sh is not POSIX shell compatible

Bug #1942430 reported by Loïc Gomez
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Canonical Juju
Fix Released
High
Loïc Gomez

Bug Description

On a model deployed with Juju 2.9.11, installing spamassassin yields a Syntax error as spamassassin post-installation script attempts to run sa-update as debian-spamd user, having /bin/sh as shell.

$ sudo dpkg --configure spamassassin
Setting up spamassassin (3.4.2-0ubuntu0.18.04.5) ...
-su: 92: /etc/profile.d/juju-introspection.sh: Syntax error: "(" unexpected (expecting "}")
dpkg: error processing package spamassassin (--configure):
 installed spamassassin package post-installation script subprocess returned error exit status 2
Errors were encountered while processing:
 spamassassin

/var/lib/dpkg/info/spamassassin.postinst:
> su - $OWNER -c "sa-update \
> --gpghomedir /var/lib/spamassassin/sa-update-keys \
> --import /usr/share/spamassassin/GPG.KEY"

$ sudo sh -c "su - $OWNER -c 'sa-update --gpghomedir /var/lib/spamassassin/sa-update-keys --import /usr/share/spamassassin/GPG.KEY'"
-su: 92: /etc/profile.d/juju-introspection.sh: Syntax error: "(" unexpected (expecting "}")

$ getent passwd debian-spamd
debian-spamd:x:113:119::/var/lib/spamassassin:/bin/sh

$ sudo sh
# . /etc/profile.d/juju-introspection.sh
sh: 92: /etc/profile.d/juju-introspection.sh: Syntax error: "(" unexpected (expecting "}")

Afaik, arrays are not part of POSIX shell specifications.
This bug probably affect other packages than spamassassin.

It seems to be an iteration of https://bugs.launchpad.net/juju/+bug/1770437

Thanks

Revision history for this message
Loïc Gomez (kotodama) wrote :
Revision history for this message
Loïc Gomez (kotodama) wrote :
John A Meinel (jameinel)
Changed in juju:
assignee: nobody → Loïc Gomez (kotodama)
importance: Undecided → High
milestone: none → 2.9.13
status: New → In Progress
Revision history for this message
Loïc Gomez (kotodama) wrote :

Opened PR https://github.com/juju/juju/pull/13309 for 2.9 branch.

Benjamin Allot (ballot)
Changed in juju:
status: In Progress → Won't Fix
status: Won't Fix → In Progress
Revision history for this message
Loïc Gomez (kotodama) wrote :
Changed in juju:
status: In Progress → Fix Released
status: Fix Released → Fix Committed
Ian Booth (wallyworld)
Changed in juju:
milestone: 2.9.13 → 2.9.14
Changed in juju:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.