Killing that process restarts the management for the TTY from the kernel, restarting the terminal itself: $ ttyĪfter using the kill command from /dev/tty2 to stop the shell of /dev/tty1, the latter terminal reverts to agetty, as we saw. Terminals stay alive only because of their initial process. Of course, killing a TTY is done with kill or pkill. This is vital for our attempts to kill the TTY. The latter can be a GUI like xorg or text-based like login. This convoluted process originates from older times, where the transition between the login shell and the terminal manager causes a connection teardown and prevents brute-force password guessing.įor our needs, we can note that a terminal is either managed by the kernel or a login shell. Importantly, multiple incorrect login attempts or a timeout will terminate login, reverting to a fresh instance of agetty with a different PID. In essence, after the first login attempt, the terminal manager (here, agetty) overlays itself with the login shell. Now, we see login process, but with the same PID ( 666) as the responsible agetty instance. Going back to /dev/tty2, let’s check the process tree of /dev/tty1 again: $ tty To explain why that is, we can do another unexpected action and enter the wrong credentials at the login prompt of /dev/tty1: baeldung login: baduser Perhaps a bit unexpected, but we now see agetty as the only process (PID 666), linked with our initial TTY. To confirm, let’s switch to /dev/tty2 and check the process tree for /dev/tty1: $ tty Now, we can do a test exiting the shell, bash, PID 167: $ kill -SIGKILL 167Īfter terminating the main shell process, our terminal seems to revert to the login shell, as expected. If you have a different favorite, tell me about it in the comments.Let’s see a real-world example by booting into Linux and logging in at the text terminal and checking our current TTY and its process tree: baeldung login: user My personal favorite is #2 for a benign restart, but I probably haven't discovered all the unique ways. If you run into a problem, one of these techniques should work for you. OS X will relaunch the Finder automatically. The SSH daemon will probably be running even if the Finder is locked up.)Ĭ. (If you can't do that from the Finder, try an SSH from another computer. The Terminal app on the Mac (or remotely)Ī. If that's not possible, log out then log in. To relaunch, click the Finder icon on the left side of the Dock. In this technique, the Finder really is stopped for good and is not relaunched. The reason for that is that Force Quit is a brutal way to stop an app, and we always want to stop an app with the least force required in order to avoid potential damage to the system.į. If that doesn't work, try again with Force Quit. Click the "x" icon on the top left under the colored buttons.Į. Optional: Click the Process name header to alphabetize the process names. If you can, launch the Activity Monitor app from /Applications/Utilities.ī. Right-click the Finder icon in the Dock while holding down the OPTION key.Ī. Note, you can always open this window directly with CMD+OPTION+ESC.Ī. It says "Relaunch" instead of "Force Quit" - which is probably what you want. (Apps that aren't responding will be shown in red.) Note that the button in Force Quit is different for the Finder app. Hold down the SHIFT key and open the Apple menu.Īlternatively, you can simply select Force Quit and relaunch the Finder from the list of running apps. Make sure the Finder is the frontmost app.ī. For example, " Frozen: How to Force the Restart of a Mac."Ī. Worst case, of course, is a restart of your Mac. If the Finder is really hosed, you may not be able to launch apps as in technique #3 below and you may have to resort to Unix trickery as in technique #4. These techniques generally assume you are doing a configuration change that requires a benign relaunch (kill and restart) of the OS X Finder. Here are four different ways to handle the Finder with a view to a kill. Or perhaps you've made a configuration change that requires a Finder restart. (It is, after all, just an app.) Perhaps it's locked up. There are times when it's necessary to restart the Mac's Finder.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |