locale-gen --purge stops after purging the locales

Bug #1300684 reported by Removed by request
6
Affects Status Importance Assigned to Milestone
langpack-locales (Ubuntu)
New
Undecided
Unassigned
upstart (Ubuntu)
New
Undecided
Unassigned

Bug Description

I'm using Ubuntu 14.04 dev with locales 2.13+git20120306-12 and upstart 1.12.1-0ubuntu1 and I have found a combination between locale-gen and upstart to cause some weird behavior. Initially my locales are looking this:

root@ubuntu:~# locale -a
C
C.UTF-8
de_AT.utf8
de_BE.utf8
de_CH.utf8
de_DE.utf8
de_LI.utf8
de_LU.utf8
en_US.utf8
POSIX

Here is an example script (stored in /etc/init/test.conf):

exec locale-gen --purge &

Here is the result:

root@ubuntu:~# start test && sleep 60 && locale -a
test stop/waiting
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_COLLATE to default locale: No such file or directory
C
C.UTF-8
POSIX

locale-gen has purged the locales but something has caused it to stop then. But if I'm forwarding stdout to /dev/null all is working fine. Here is the updated script:

exec locale-gen --purge > /dev/null &

And this is now the result:

root@ubuntu:~# start test && sleep 60 && locale -a
test stop/waiting
C
C.UTF-8
de_AT.utf8
de_BE.utf8
de_CH.utf8
de_DE.utf8
de_LI.utf8
de_LU.utf8
en_US.utf8
POSIX

Revision history for this message
Gunnar Hjalmarsson (gunnarhj) wrote :

Thanks for your report.

Can you please let us know the output of the locale command?

Revision history for this message
Removed by request (removed3425744) wrote :

Redirecting the output to a file will cause the same result as redirecting it to /dev/null. In this case the output is "Generating locales...
  de_AT.UTF-8... done
  de_BE.UTF-8... done
  de_CH.UTF-8... done
  de_DE.UTF-8... done
  de_LI.UTF-8... done
  de_LU.UTF-8... done
  en_US.UTF-8... done
Generation complete.
". Maybe you want to try the testcase as descibed in the startpost to see if you are able to reproduce this issue.

Revision history for this message
Gunnar Hjalmarsson (gunnarhj) wrote :

I just run sudo locale-gen --purge on my 14.04 without any issue. You are the one with a problem, and the error messages in the bug description indicate that you have a locale set which is not available on your system, so I ask you again to please let us know the output of the locale command.

Revision history for this message
Removed by request (removed3425744) wrote :

> I just run sudo locale-gen --purge on my 14.04 without any issue.

Probably you want to reread the startpost.

Revision history for this message
Gunnar Hjalmarsson (gunnarhj) wrote :

Ok, I can reproduce it. Noticed that the environment when running the script gets reduced to:

UPSTART_INSTANCE=
UPSTART_JOB=test
TERM=linux
PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin
PWD=/

and that's not sufficient to run locale-gen.

Why on earth do you want to re-generate all locales at boot?

Revision history for this message
Removed by request (removed3425744) wrote :

> and that's not sufficient to run locale-gen.

Do you maybe know what is missing and why it works if the output gets redirected?

> Why on earth do you want to re-generate all locales at boot?

Upstart scripts may also be started a long time after the system has booted. I have just found this bug at some point in the past and I'm normally reporting every bug I'm finding.

Revision history for this message
Gunnar Hjalmarsson (gunnarhj) wrote :

On 09/15/2014 09:28 PM, Sworddragon wrote:
>> and that's not sufficient to run locale-gen.
>
> Do you maybe know what is missing and why it works if the output
> gets redirected?

No, I don't. Sorry.

>> Why on earth do you want to re-generate all locales at boot?
>
> Upstart scripts may also be started a long time after the system has
> booted. I have just found this bug at some point in the past and I'm
> normally reporting every bug I'm finding.

I see. Maybe it is a subtle bug, maybe it's expected behaviour. I for one am not able to tell.

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.