juju-introspection.sh causes error if user's shell is /bin/sh

Bug #1806776 reported by Drew Freiberger on 2018-12-04
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
juju-core
Undecided
Unassigned

Bug Description

/etc/profile.d/juju-introspection.sh includes function definitions that are incompatible with the shell /bin/sh. Error is:

-su: 31: /etc/profile.d/juju-introspection.sh: Syntax error: Bad function name

I suspect the dashes in the function names are not supported in sh. Changing user shell to /bin/bash does resolve issue, however, for legacy support, it may be best to wrap the functions with dashes and the exports of the same in an 'if [ X$SHELL != X/bin/sh ]; then' block to allow for completion of profile setup for users with non-bash bourne shells.

Tim Penhey (thumper) wrote :

I believe this was fixed in 2.4. What version of Juju do you have?

Changed in juju-core:
status: New → Incomplete
Drew Freiberger (afreiberger) wrote :

Snap installed juju 2.4.7 6012 stable

Can't even find this file anywhere in the snap.
-rw-r--r-- 1 root root 1651 Sep 3 00:01 juju-introspection.sh

It's quite possible that juju-introspection came along for a ride with a previously dpkg installed juju that was 2.3.x given it was September.

My apt logs aren't going back far enough to validate.

Changed in juju-core:
status: Incomplete → In Progress
Tim Penhey (thumper) wrote :

Need the juju version of the model, not the client.

Haw Loeung (hloeung) wrote :

I don't think the juju version of the model matters though, since it's the various shell aliases on the client's end.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers