Mac OS X Terminal не входит в систему

14552
Wuffers

Я использую Mac OS X версии 10.6.3, и когда я открываю терминал (с помощью Terminal.app или iterm), он просто зависает в процессе входа в систему. Я попытался перезапустить компьютер, изменив команду запуска на / bin / bash и удалив файл настроек терминала. Все безрезультатно.

9

4 ответа на вопрос

6
Dan

I had a similar problem.
In my case, Terminal would stall saying 'Terminal — login — 80x24' in the title.

I didn't want to reinstall Terminal from OS X disk, and so I followed several different procedures, and in the end one of them seemed to have worked. I'm not certain which is most important, but I decided to share my exact steps in case someone finds them helpful:

1. Move com.apple.Terminal.plist away from ~/Library/Preferences/.

com.apple.Terminal.plist

Some report that Terminal configuration file might get messed up and prevent the app from starting.
Move this file somewhere for backup, quit the Terminal and start it again.

In my case, resetting the configuration changed font and color settings to default, but the problem persisted. If so did yours, proceed to the step two:

2. Try running shell other than bash

changing shell used by Terminal

Some advice to change default shell in the Terminal to /bin/zsh and restart the Terminal to see if the problem is specific to bash. In my case, doing so changed nothing, and the Terminal would still hang at login.

3. Try moving .bash* files away from home directory

I remembered that during previous session I created .bash_profile file in my directory. Perhaps something is really wrong with it. If you haven't created one yourself, some installer could've created (or edited) it, especially if the software is not specific to Mac OS.

Unfortunately, Finder doesn't show hidden files by default and doesn't provide an easy way to do this. However, in my case, I found that Automator could actually run bash commands successfully:

moving bash files with Automator

This is the script that I used:

cd ~ mkdir backup for F in .bash* do mv $F backup done 

It moved all files starting with .bash in my home directory to backup subdirectory.

4. Reboot

Restarting the app didn't work for me at this point but I decided to also give reboot a try.
After rebooting, Terminal worked. Voilà!

I moved the saved com.apple.Terminal.plist back to ~/Library/Preferences/, replacing the current one, and decided not to restore old (and somewhat not too useful) .bash* files and deleted backup directory.

I don't know whether it was a coincidence or a combination of specific steps that solved the problem but I'm glad that the Terminal is working again, and I hope yours will do so, too.

Terminal working again

4
Brian Postow

Возможно, у вас есть ошибка в вашем файле .bashrc ... Вы можете попробовать вставить в ваш .bashrc операторы echo, или удалить его, или попробовать tcsh вместо bash, чтобы убедиться, что это проблема ...

ОК, я понятия не имею, что случилось, но сейчас это работает. Как вы думаете, я должен отметить это как решенное или нет? Wuffers 14 лет назад 0
Если текущим процессом является «вход в систему», это обычно означает, что вход в систему ожидает создания сеанса входа в систему и еще даже не пытался запустить оболочку. Чтобы убедиться в этом, посмотрите в Activity Monitor и посмотрите, работает ли оболочка или вы видите только процесс входа в систему. Chris Page 12 лет назад 0
1
Chris Page

Если текущим процессом является «вход в систему», это обычно означает, что вход в систему ожидает создания сеанса входа в систему и еще даже не пытался запустить оболочку. Чтобы убедиться в этом, посмотрите в Activity Monitor и посмотрите, работает ли оболочка или вы видите только процесс входа в систему. Обратите внимание, что если у вас открыты другие терминалы, вы можете увидеть другие процессы «входа» и оболочки для них, поэтому будьте осторожны с тем, какие процессы вы проверяете. Неисправный процесс обычно самый последний с наибольшим номером идентификатора процесса (PID).

Я понимаю, что Марк Шимански сказал, что перезагрузка в его случае не помогла, но я подумал, что должен все же упомянуть об этом: если он действительно застрял в «логине», наиболее распространенная причина - вы запустили «sudo», а затем закрыли терминал пока он ждал, пока вы введете свой пароль. Если вы сделаете это, sudo будет ждать пароль вечно, и это блокирует все входы в систему, пока вы не уничтожите процесс sudo. Самый простой способ решить проблему - это перезагрузить компьютер. Кроме того, вы можете убить sudo из Activity Monitor (или из другого терминала, если он у вас уже открыт). Начиная с Mac OS X Lion 10.7, sudo будет замечать, когда терминал отключается и перестает ждать пароль, поэтому эта проблема больше не должна возникать.

Еще одна причина задержки входа в систему - это если вы подключены к сети Open Directory, а сервер каталогов работает медленно или не отвечает. Сообщите об этом вашему сетевому администратору. Обычно это вызывает задержки в несколько секунд, но в некоторых случаях они могут длиться до нескольких минут.

0
Mirko Ebert

The problem is not the shell or the network. Remove the *.asl files:

sudo rm -rf /private/var/log/asl/*.asl 

It takes time, because it starts a new shell. But after it, it work fine again.

Похожие вопросы