snappy images should not ship /etc/profile.d/Z99-cloud-locale-test.sh

Bug #1637611 reported by Barry Warsaw
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Snappy
Fix Released
Medium
Oliver Grawert
livecd-rootfs (Ubuntu)
Fix Committed
Medium
Oliver Grawert

Bug Description

ssh into a snappyfied beagleboardblack and you get the following warning:

It's a brave new world here in Snappy Ubuntu Core! This machine
does not use apt-get or deb packages. Please see 'snap --help'
for app installation and transactional updates.

_____________________________________________________________________
WARNING! Your environment specifies an invalid locale.
 The unknown environment variables are:
   LC_CTYPE=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8 LC_ALL=
 This can affect your user experience significantly, including the
 ability to manage packages. You may install the locales by running:

  sudo apt-get install locales
   sudo apt-get install language-pack-en
     or
   sudo locale-gen en_US.UTF-8

To see all available language packs, run:
   apt-cache search "^language-pack-[a-z][a-z]$"
To disable this message for all users, run:
   sudo touch /var/lib/cloud/instance/locale-check.skip
_____________________________________________________________________

It's funny that the first message tells us not to use apt-get and then the second one tells us to do exactly that! Ideally of course, the locale would be automatically set up correctly.

Revision history for this message
Oliver Grawert (ogra) wrote :

hmm, we enfoce C.UTF-8 via a profile.d snippet on login since the images contain no locales at all by default (way to heavyweight for IoT devices), smells like there is still something wrong thanks to cloud-init.

i have never seen this message before in 2 years working with snappy images (and haven't heard of anyone else who got it) this is pretty weird.

Revision history for this message
Oliver Grawert (ogra) wrote :

seems /etc/profile.d/Z99-cloud-locale-test.sh is new, we need to remove it at build time since we do not ship any locales it will always fail and we enforce C.UTF-8 for every login.

summary: - UTF-8 local via ssh is poorly handled
+ snappy images should not ship /etc/profile.d/Z99-cloud-locale-test.sh
Changed in livecd-rootfs (Ubuntu):
assignee: nobody → Oliver Grawert (ogra)
Changed in snappy:
assignee: nobody → Oliver Grawert (ogra)
Changed in livecd-rootfs (Ubuntu):
importance: Undecided → Medium
Changed in snappy:
importance: Undecided → Medium
status: New → Confirmed
Changed in livecd-rootfs (Ubuntu):
status: New → Confirmed
Revision history for this message
Oliver Grawert (ogra) wrote :

livecd-rootfs (2.420+ppa47) xenial; urgency=medium

  * remove /etc/profile.d/Z99-cloud-locale-test.sh (LP: #1637611)

 -- Oliver Grawert <email address hidden> Sat, 29 Oct 2016 12:49:50 +0200

Changed in livecd-rootfs (Ubuntu):
status: Confirmed → Fix Committed
Changed in snappy:
status: Confirmed → Fix Committed
Revision history for this message
Oliver Grawert (ogra) wrote :

now in the edge channel ...

Changed in livecd-rootfs (Ubuntu):
status: Fix Committed → Fix Released
Changed in snappy:
status: Fix Committed → Fix Released
Revision history for this message
Ryan Harper (raharper) wrote :

If the cloud-init used in the build does not ship the Z99-cloud-local-tests.sh, the hook script exits non-zero and fails the build.

https://launchpadlibrarian.net/301226697/buildlog_snap_ubuntu_xenial_amd64_core_BUILDING.txt.gz

Looking at the failed hook:

(foudres) hooks % cat 19-remove-cloud-init-locale-test.chroot
#!/bin/sh

set -e

# bug #1637611
echo "removing /etc/profile.d/Z99-cloud-locale-test.sh"
[ -e /etc/profile.d/Z99-cloud-locale-test.sh ] && rm /etc/profile.d/Z99-cloud-locale-test.sh

(foudres) hooks % sh -x ./19-remove-cloud-init-locale-test.chroot
+ set -e
+ echo removing /etc/profile.d/Z99-cloud-locale-test.sh
removing /etc/profile.d/Z99-cloud-locale-test.sh
+ [ -e /etc/profile.d/Z99-cloud-locale-test.sh ]
(foudres) hooks % echo $?
1

Would it be reasonable to just add an 'exit 0' in the case that the file is not-present so the build handles cloud-init with and without the profile test?

Revision history for this message
Oliver Grawert (ogra) wrote :

totally reasonable ... re-opening

Changed in livecd-rootfs (Ubuntu):
status: Fix Released → In Progress
Changed in snappy:
status: Fix Released → In Progress
Revision history for this message
Oliver Grawert (ogra) wrote :

well, actually ... an exit 0 will prevent logins, is it enough if the file exists ?

Revision history for this message
Oliver Grawert (ogra) wrote :

i uploaded the following now, please check if this is enough:

ogra@anubis:~$ cat live-build/ubuntu-core/hooks/19-remove-cloud-init-locale-test.chroot
#!/bin/sh

set -e

# bug #1637611
echo "turning /etc/profile.d/Z99-cloud-locale-test.sh into a no-op"
if [ -e /etc/profile.d/Z99-cloud-locale-test.sh ]; then
 cat >/etc/profile.d/Z99-cloud-locale-test.sh<<EOF
#!/bin/sh

return 0
EOF
fi

Changed in snappy:
status: In Progress → Fix Committed
Changed in livecd-rootfs (Ubuntu):
status: In Progress → Fix Committed
Changed in snappy:
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.