Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix /etc/profile.d/juju-introspection.sh not being POSIX-shell compatible #13309

Merged
merged 1 commit into from Sep 6, 2021

Conversation

kot0dama
Copy link
Contributor

@kot0dama kot0dama commented Sep 6, 2021

See also #13299

/etc/profile.d/juju-introspection.sh contains a few bash arrays, breaking POSIX shell compatibility and at least some packages post-installation as it is loaded as a profile script.

For example, 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.

The change includes variables name changes (and a comment) to avoid future updates breaking POSIX compatibility.
Feel free to update the comment to whatever you see fit.

QA steps

  • Check it builds properly
  • Deploy a model with spamassassin installation (eg. charm cs:mailman3-core) and check it doesn't fail during SA install.

Bug reference

Fixes https://bugs.launchpad.net/juju/+bug/1942430
Probable iteration of https://bugs.launchpad.net/juju/+bug/1770437

@jujubot
Copy link
Collaborator

jujubot commented Sep 6, 2021

Can one of the admins verify this patch?

12 similar comments
@jujubot
Copy link
Collaborator

jujubot commented Sep 6, 2021

Can one of the admins verify this patch?

@jujubot
Copy link
Collaborator

jujubot commented Sep 6, 2021

Can one of the admins verify this patch?

@jujubot
Copy link
Collaborator

jujubot commented Sep 6, 2021

Can one of the admins verify this patch?

@jujubot
Copy link
Collaborator

jujubot commented Sep 6, 2021

Can one of the admins verify this patch?

@jujubot
Copy link
Collaborator

jujubot commented Sep 6, 2021

Can one of the admins verify this patch?

@jujubot
Copy link
Collaborator

jujubot commented Sep 6, 2021

Can one of the admins verify this patch?

@jujubot
Copy link
Collaborator

jujubot commented Sep 6, 2021

Can one of the admins verify this patch?

@jujubot
Copy link
Collaborator

jujubot commented Sep 6, 2021

Can one of the admins verify this patch?

@jujubot
Copy link
Collaborator

jujubot commented Sep 6, 2021

Can one of the admins verify this patch?

@jujubot
Copy link
Collaborator

jujubot commented Sep 6, 2021

Can one of the admins verify this patch?

@jujubot
Copy link
Collaborator

jujubot commented Sep 6, 2021

Can one of the admins verify this patch?

@jujubot
Copy link
Collaborator

jujubot commented Sep 6, 2021

Can one of the admins verify this patch?

Copy link
Contributor

@achilleasa achilleasa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

local -a args
for i in "${arr[@]}"; do
args+=("unit=$i")
args=""
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor nit; this loop should probably be extracted in a separate func and reused below.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for pointing that out @achilleasa

Actually, the whole juju_start_unit/juju_stop_unit could have been abstracted into a _juju_action_unit but I didn't want to change the code that much for a small compatibility fix.

Thanks for the merge !

@juanmanuel-tirado
Copy link
Contributor

$$merge$$

@jujubot jujubot merged commit 8a8c0ed into juju:2.9 Sep 6, 2021
@achilleasa achilleasa mentioned this pull request Sep 13, 2021
jujubot added a commit that referenced this pull request Sep 13, 2021
#13329

This PR forward ports 2.9 into develop. The following PRs are included in this port:
 - Merge pull request #13324 from achilleasa/2.9-add-ovs-integration-test
 - Merge pull request #13328 from manadart/2.9-assess-series-upgrade
 - Merge pull request #13327 from wallyworld/azure-tests-fix
 - Merge pull request #13325 from SimonRichardson/raft-worker-errors
 - Merge pull request #13274 from SimonRichardson/lxd-network-devices-config-host-name
 - Merge pull request #13323 from jujubot/increment-to-2.9.15
 - Merge pull request #13321 from wallyworld/more-secret-metadata
 - Merge pull request #13319 from manadart/2.9-bridge-policy
 - Merge pull request #13320 from SimonRichardson/revert-lxd-changes
 - Merge pull request #13194 from juanmanuel-tirado/patch-1
 - Merge pull request #13318 from hpidcock/fix-1942948
 - Merge pull request #13314 from simondeziel/snap-ack
 - Merge pull request #13297 from achilleasa/2.9-allow-empty-openvswitch-blocks-in-netplan-config
 - Merge pull request #13317 from jujubot/increment-to-2.9.14
 - Merge pull request #13316 from hpidcock/fix-1942948
 - Merge pull request #13296 from ycliuhw/fix/registry-oauth2
 - Merge pull request #13311 from wallyworld/unitagent-missing-charm
 - Merge pull request #13315 from wallyworld/lxd-not-found-fix
 - Merge pull request #13221 from juanmanuel-tirado/status_watch_flag
 - Merge pull request #13312 from wallyworld/remove-txnwatcher-started
 - Merge pull request #13309 from kot0dama/fix-instrospection-posix-shell-2.9

The following files had merge conflicts that had to be resolved (please double-check the changes in last commit):
- caas/kubernetes/provider/bootstrap_test.go
- feature/flags.go
- scripts/win-installer/setup.iss
- snap/snapcraft.yaml
- state/pool.go
- version/version.go
- worker/uniter/relation/state_test.go
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants