Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I'm running linux mint 14 and when I try to log in I get an error saying "Session lasted less than 10 seconds...". When I click on details it says:

/etc/mdm/Xsession: Beginning session setup...
/etc/mdm/Xsession: 1: /etc/profile: id: not found
/etc/mdm/Xsession: 12: [: Illegal number:
/etc/mdm/Xsession: 173: /etc/mdm/Xsession: grep: not found
/etc/mdm/Xsession: Executing default failed, will try to run x-terminal-emulator
/etc/mdm/Xsession: 205: exec: x-terminal-emulator: not found

I edited the /etc/environment file so maybe that has something to do with it.

I restarted in recovery mode and selected "Drop to root shell prompt". I attempted to edit the /etc/environment file, but it says it's read only (even while using sudo).

What can i do?

share|improve this question
    
What changes did you make to that file? That error seems to be complaining about something in /etc/profile and /etc/mdm/Xsession. And seems to be complaining about a bunch of missing commands that really should exist. In recovery mode your disk is probably in read-only mode. You probably just need to remount it read-write. –  Etan Reisner Nov 26 '13 at 19:03
    
i was installing Ant and changed contents of environment file to: ANT_HOME=/apache-install-dir/apache-ant-version ANT_OPTS="-Xms256M -Xmx512M" PATH=$PATH:$HOME/bin:$ANT_HOME/bin export ANT_HOME ANT_OPTS PATH –  user1716672 Nov 26 '13 at 19:12
    
how do i remount in read-write? –  user1716672 Nov 26 '13 at 19:12
1  
mount -o remount,rw / or so. –  Etan Reisner Nov 26 '13 at 19:16
1  
@user1716672 no spaces in remount,rw –  DerfK Nov 26 '13 at 19:41

1 Answer 1

I mounted with read-write privileges with:

mount -o remount,rw /

And changed contents of environment file back to:

PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games"

This solved the problem.

share|improve this answer
    
If you learn nothing else from this exercise, hopefully it will teach you to make a copy of any system file before changing it. It makes backing out your changes much easier afterwards! –  MadHatter Nov 27 '13 at 9:49

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.