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

Bug #1806776 reported by Drew Freiberger
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
juju-core
In Progress
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.

Revision history for this message
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
Revision history for this message
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
Revision history for this message
Tim Penhey (thumper) wrote :

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

Revision history for this message
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  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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