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

Bug #993407 reported by Brian Murray on 2012-05-02
54
This bug affects 12 people
Affects Status Importance Assigned to Milestone
texinfo (Ubuntu)
Undecided
Unassigned
Changed in texinfo (Ubuntu):
assignee: nobody → Canonical Foundations Team (canonical-foundations)
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
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.

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

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.

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

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
------------------------------------------------------------------------

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

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
------------------------------------------------------------------------

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.

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.

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.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers