cloud-init profile.d files use bash-specific builtin "local"

Bug #1784713 reported by Merlie Allen on 2018-07-31
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
cloud-init
Low
Scott Moser
cloud-init (Ubuntu)
Low
Unassigned

Bug Description

/etc/profile, which is read by the Bourne-like shells (including ksh),
runs the scripts in /etc/profile.d. The scripts from the cloud-init
package Z99-cloudinit-warnings.sh and Z99-cloud-locale-test.sh
use the bash-builtin "local" which is not recognized by ksh resulting
in these errors at login:

/etc/profile[23]: .[141]: local: not found [No such file or directory]
/etc/profile[23]: .[142]: local: not found [No such file or directory]
/etc/profile[23]: .[143]: local: not found [No such file or directory]
/etc/profile[23]: .[178]: local: not found [No such file or directory]
/etc/profile[23]: .[179]: local: not found [No such file or directory]

$ grep -n local\ Z99*
Z99-cloudinit-warnings.sh:7: local warning="" idir="/var/lib/cloud/instance" n=0
Z99-cloudinit-warnings.sh:8: local warndir="$idir/warnings"
Z99-cloudinit-warnings.sh:9: local ufile="$HOME/.cloud-warnings.skip" sfile="$warndir/.skip"
Z99-cloud-locale-test.sh:14: local bad_names="" bad_lcs="" key="" val="" var="" vars="" bad_kv=""
Z99-cloud-locale-test.sh:15: local w1 w2 w3 w4 remain
Z99-cloud-locale-test.sh:56: local bad invalid="" to_gen="" sfile="/usr/share/i18n/SUPPORTED"
Z99-cloud-locale-test.sh:57: local pkgs=""
Z99-cloud-locale-test.sh:70: local pkgs=""

ProblemType: Bug
DistroRelease: Ubuntu 18.04
Package: cloud-init 18.2-27-g6ef92c98-0ubuntu1~18.04.1
ProcVersionSignature: Ubuntu 4.15.0-29.31-generic 4.15.18
Uname: Linux 4.15.0-29-generic x86_64
ApportVersion: 2.20.9-0ubuntu7.2
Architecture: amd64
CloudName: Other
Date: Tue Jul 31 20:04:30 2018
PackageArchitecture: all
ProcEnviron:
 TERM=xterm
 PATH=(custom, no user)
 XDG_RUNTIME_DIR=<set>
 LANG=en_US.UTF-8
 SHELL=/bin/ksh
SourcePackage: cloud-init
UpgradeStatus: No upgrade log present (probably fresh install)

Related branches

Merlie Allen (merlieallen) wrote :
description: updated
Scott Moser (smoser) on 2018-07-31
Changed in cloud-init (Ubuntu):
status: New → Confirmed
importance: Undecided → Low
Scott Moser (smoser) wrote :

Can you test if this works?

http://paste.ubuntu.com/p/wyPPhjRRzP/

Scott Moser (smoser) wrote :

@Merlie,
could you please test the attached merge proposal and report if it works?

This bug is fixed with commit 538af8e6 to cloud-init on branch master.
To view that commit see the following URL:
https://git.launchpad.net/cloud-init/commit/?id=538af8e6

Scott Moser (smoser) on 2018-08-06
Changed in cloud-init:
assignee: nobody → Scott Moser (smoser)
importance: Undecided → Low
status: New → Fix Committed
Scott Moser (smoser) on 2018-09-14
Changed in cloud-init (Ubuntu):
status: Confirmed → Fix Released

This bug is believed to be fixed in cloud-init in version 18.4. If this is still a problem for you, please make a comment and set the state back to New

Thank you.

Changed in cloud-init:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers