install-info can fail to install due to syntax errors in /etc/environment

Bug #993407 reported by Brian Murray
62
This bug affects 13 people
Affects Status Importance Assigned to Milestone
texinfo (Ubuntu)
Confirmed
Undecided
Unassigned
Changed in texinfo (Ubuntu):
assignee: nobody → Canonical Foundations Team (canonical-foundations)
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in texinfo (Ubuntu):
status: New → Confirmed
tags: added: bugpattern-written
Revision history for this message
Paul (paul-wozney) wrote :

It looks like /etc/environment is trying to call export, but it is case sensitive.

So I modified /etc/environment from this:
$ cat /etc/environment
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games"
EXPORT GNOME_SHELL_DISABLE_TFP=1

To this:
$ cat /etc/environment
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games"
EXPORT GNOME_SHELL_DISABLE_TFP=1

And it works.

Revision history for this message
Paul (paul-wozney) wrote :

Ahh oops. I meant I changed it to this:

$ cat /etc/environment
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games"
export GNOME_SHELL_DISABLE_TFP=1

Revision history for this message
Steve Langasek (vorlon) wrote :

You should not have the 'export' word in /etc/environment at all. *all* variables in /etc/environment are exported; the parser simply ignores this for compatibility.

Revision history for this message
Mike Kristoffersen (mike-kristoffersen) wrote :

My mistake in the /etc/environment file that probably provoked this error was that I had a line:

# Setup JDK
JAVA_HOME="/usr/lib/jvm/java-6-openjdk-amd64/

Instead of:

# Setup JDK
JAVA_HOME="/usr/lib/jvm/java-6-openjdk-amd64/"

Note the missing terminating '"'

Changed in texinfo (Ubuntu):
assignee: Canonical Foundations Team (canonical-foundations) → nobody
Revision history for this message
Norbert Preining (preining) wrote : Re: [Bug 993407] Re: install-info can fail to install due to syntax errors in /etc/environment

On Do, 10 Okt 2013, Brian Murray wrote:
> The package install-info sources /etc/environment and will fail to
> install if there are any configuration errors in that file. This
> seems to happen a fair bit.

Yes, and if we ad
 rm -rf /
into /etc/profile then we can also get bugs ...

I don't care for bugs that are misconfiguration of users. We cannot
protect users from shooting themselves ...

Norbert

------------------------------------------------------------------------
PREINING, Norbert http://www.preining.info
JAIST, Japan TeX Live & Debian Developer
DSA: 0x09C5B094 fp: 14DF 2E6C 0307 BE6D AD76 A9C0 D2BF 4AA3 09C5 B094
------------------------------------------------------------------------

Revision history for this message
getman (getmanartem) wrote :

I found usefull advice about changing 'EXPORT' to 'export'. Additional rised the follow error:
/etc/environment: string 13: PGDATA: command not found
because I have set up PostgreSQL db. The reason is comically - extra spaces on the follow string
PGDATA = "/var/lib/postgresql/data" <----errors!
PGDATA="/var/lib/postgresql/data" <----ok

Revision history for this message
Norbert Preining (preining) wrote :

On Do, 24 Okt 2013, getman wrote:
> I found usefull advice about changing 'EXPORT' to 'export'. Additional rised the follow error:
> /etc/environment: string 13: PGDATA: command not found
> because I have set up PostgreSQL db. The reason is comically - extra spaces on the follow string
> PGDATA = "/var/lib/postgresql/data" <----errors!
> PGDATA="/var/lib/postgresql/data" <----ok

Guys, if you are not able to write correct shell code, and put it
into one of the central configuration files, then I am sorry for you,
but I will not change anything.

I cannot prevent you from shooting yourself in the knee.

Can someone please close this bug ...

Enjoy

Norbert

------------------------------------------------------------------------
PREINING, Norbert http://www.preining.info
JAIST, Japan TeX Live & Debian Developer
DSA: 0x09C5B094 fp: 14DF 2E6C 0307 BE6D AD76 A9C0 D2BF 4AA3 09C5 B094
------------------------------------------------------------------------

Revision history for this message
Mike Kristoffersen (mike-kristoffersen) wrote :

Fair enough if there is a proper error message in some log that describes that it's because of an error in a given configuration file that is the cause of the failure to update.

Revision history for this message
J Richard Snape (snapey) wrote :

Same as @getman above - had spaces in my definition of JAVA_HOME. Norbert raises a fair point about the file being incorrect, rather thanthis being a genuine bug. The error message did point to a problem with the JAVA_HOME variable, but not the specific error in the /etc/environment file. As mike-kristoffersen says a more informative error message would be helpful.

Revision history for this message
Antonios Hadjigeorgalis (antonioshadji) wrote :

I had added the following lines to my /etc/environment
LC_COLLATE=C
VISUAL=/usr/local/bin/vim
EDITOR=/usr/local/bin/vim
first_weekday 2

I removed the lines and the error went away. I was recently working on some changes and forgot to remove these changes after testing. I have these lines in my user configuration files now.

Revision history for this message
Matheson Steplock (ikifar) wrote :

In my case I checked the '/etc/environment' file and noticed I had a variable from cloudflared named 'CLOUDFLARED_OPTS' and the value of that variable was not quoted. Simply quoting the value of 'CLOUDFLARED_OPTS' resolved the issue

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.