Skip to content

The Eclectic Light Company

Macs & painting – 🦉 No AI content
Main navigation
  • Downloads
  • Freeware
  • M-series Macs
  • Mac Problems
  • Mac articles
  • Macs
  • Art
hoakley March 18, 2023 Macs, Technology

loginwindow does more than log you in

If there’s a Cinderella in macOS, it has to be loginwindow. While it has its moment of glory when it provides the one window we all have to use, to log in, it does a great deal more work behind the scenes, which passes largely unacknowledged. Browse the log for the seconds immediately after you’ve logged in and you’ll see what I mean: every other entry is from loginwindow as its sets everything up for the newly logged-in user. It’s a proper application too, found in /System/Library/CoreServices, so part of the Signed System Volume (SSV) in Big Sur and later, even though it isn’t allowed a distinctive icon. Poor Cinders!

Startup

After the kernel and launchd, loginwindow is probably the third most important process to run in macOS, although it’s not given a distinctive process ID. It’s run by launchd late during the boot process, once sufficient system services have been loaded and prepared for control to be handed over to a user.

Its most obvious task is to prepare, display, handle and destroy the user login window. This is shown following every startup (not in special modes such as Recovery), except when auto-login is configured (only permitted when FileVault isn’t enabled), and the reboot performed at the end of installing a macOS update.

Once a valid user and password have been entered, and FileVault has been unlocked together with the login keychain, loginwindow gets to work creating the user environment, loading up user processes, configuring all user settings, and loading key apps to create the GUI environment, including the Desktop, Dock and Finder. It’s also responsible for loading user Login Items.

With the bulk of its work complete, loginwindow still isn’t done, and you’ll find it as an active process in Activity Monitor, as it persists until the Mac is shut down. It’s then responsible for handling the Force Quit dialog, together with logout, restart and shut down actions.

It works closely at times with TAL, the macOS Transparent App Lifecycle, which helps it restore sessions across reboots using the many folders containing saved states in the ~/Library/Saved Application State folder. You’ll also see TAL active in the log as the subsystem com.apple.talagent.

App startup

Among everything else that’s going on when you open an app, loginwindow does its bit too. This involves creating a new active tracking timer, and checking the app in. You may also see its log entries referring to ‘snapshots’, although those are saved states of the app, not APFS snapshots. In conjunction with TAL, loginwindow keeps track of background and foreground apps, and maintains a list of apps to be relaunched in the event of a restart or shutdown. Those records are removed when the app is quit.

Shutdown

When the user chooses a command to log out, restart or shut down the Mac, that sends an AppleEvent to loginwindow, which displays the normal confirmation dialog. If the user confirms the action, loginwindow is then responsible for quitting all user processes. For apps, this in turn results in each calling their applicationShouldTerminate code, or receiving an AppleEvent to quit. They are then given 45 seconds grace to reply or quit, after which their termination sequence is stopped, leaving the user to handle that app in a Force Quit dialog if necessary.

Background processes are first sent an AppleEvent, then loginwindow sends them a SIGKILL signal to finish them off. System daemons should receive a SIGTERM signal initially, followed a few seconds later by SIGKILL. Once all processes have gone, loginwindow initiates the logout, restart or shutdown as appropriate.

Not only is loginwindow there in its full glory at the start of the user phase of startup, but it’s there until the bitter end.

Reference

Apple’s Daemons and Services Programming Guide, last revised in 2016.

Share this:

  • Click to share on X (Opens in new window) X
  • Click to share on Facebook (Opens in new window) Facebook
  • Click to share on Reddit (Opens in new window) Reddit
  • Click to share on Pinterest (Opens in new window) Pinterest
  • Click to share on Threads (Opens in new window) Threads
  • Click to share on Mastodon (Opens in new window) Mastodon
  • Click to share on Bluesky (Opens in new window) Bluesky
  • Click to email a link to a friend (Opens in new window) Email
  • Click to print (Opens in new window) Print
Like Loading...

Related

Posted in Macs, Technology and tagged login, loginwindow, macOS, macOS 13, shutdown, TAL, Ventura. Bookmark the permalink.

13Comments

Add yours
  1. 1
    Jerry's avatar
    Jerry on March 18, 2023 at 12:46 pm

    It also seems to take roughly a quarter of all computer resources at many times long after login … tried just the other day to see what made it use more energy than other energy heavy drawing software, but failed to mail it down.

    LikeLiked by 1 person

    • 2
      hoakley's avatar
      hoakley on March 18, 2023 at 4:26 pm

      loginwindow shouldn’t be using significant CPU or memory more than a few seconds after login. I think maybe a trip to the log is needed to investigate?
      Howard.

      LikeLike

      • 3
        Jerry's avatar
        Jerry on March 18, 2023 at 4:30 pm

        Yes, likely so. Still dread to try it though and the reason I first heard about you was because of your tools to handle the log – so should practise a bit more ..

        LikeLiked by 1 person

        • 4
          hoakley's avatar
          hoakley on March 18, 2023 at 4:35 pm

          I’ll see if I can write you a little tutorial next week to give you a start.
          Howard.

          LikeLike

  2. 5
    Duncan's avatar
    Duncan on March 18, 2023 at 3:31 pm

    “After the kernel and launchd, loginwindow is probably the third most important process to run in macOS, although it’s not given a distinctive process ID.”

    I’m seeing a PID assigned in Activity Monitor (it’s currently 4925 for my non-admin user account). Do you mean that it’s not given a PID at its start, but assigned one later?

    LikeLiked by 1 person

    • 6
      hoakley's avatar
      hoakley on March 18, 2023 at 4:30 pm

      “it’s not given a distinctive process ID”
      Every process from the kernel onwards has a process ID (PID). However, only two have *distinctive* PIDS: the kernel (0) and launchd (1). Those are useful, as you only have to see either and you know immediately which process they refer to. Sadly, loginwindow comes too late in the boot sequence to get a *distinctive* PID, as does WindowServer, another key process.
      Howard.

      LikeLike

      • 7
        Duncan's avatar
        Duncan on March 18, 2023 at 6:45 pm

        Thank you for the explanation. I wasn’t aware that ‘distinctive’ PIDs stood apart.

        LikeLiked by 1 person

  3. 8
    gaelans's avatar
    gaelans on March 18, 2023 at 3:33 pm

    Wait, who shows the login screen at boot when FileVault is enabled? I’d assumed it was the bootloader (because the kernel and loginwindow live on the encrypted disk), but is that not the case anymore? (Is the SSV stored unencrypted? I suppose that would make enough sense.)

    LikeLiked by 1 person

    • 9
      hoakley's avatar
      hoakley on March 18, 2023 at 4:34 pm

      “who shows the login screen at boot when FileVault is enabled?” loginwindow, as I’ve explained.
      “the kernel and loginwindow live on the encrypted disk” the Data volume is encrypted, not the System volume or SSV, as explained in Apple’s Platform Security Guide. Otherwise iBoot couldn’t boot the kernel as it has to. LLB and iBoot aren’t equipped with anything like the GUI etc. that loginwindow needs, nor access to usernames and passwords.
      There’s also no need for the System volume, SSV, or Recovery volumes to be encrypted – they don’t contain any protected data.
      Howard.

      LikeLike

  4. 10
    Joshua's avatar
    Joshua on April 19, 2023 at 2:17 pm

    Guys do you know why this event takes more and more memory resources if MacBook is not turned off or restarted for a long long time?
    For example, sometimes after 1 week on time, loginwindow is eating around 1gb of the memory. Do you have any idea. I’m using Ventura.

    LikeLiked by 1 person

    • 11
      hoakley's avatar
      hoakley on April 19, 2023 at 8:07 pm

      Running for a long time isn’t the issue: this iMac Pro only gets restarted every few weeks, and loginwindow currently is only using 38 MB. So I think you need to look for another cause, perhaps some third-party software you have installed.
      That said, I’ve always recommended that notebooks are shut down overnight for at least one night a week, rather than left sleeping. When you start them up again, the difference is well worth the minimal inconvenience.
      Howard.

      LikeLike

  5. 12
    Rod's avatar
    Rod on July 23, 2023 at 11:17 pm

    Hello.

    Loginwindow has been driving me crazy for months. This is the first site I’ve found that seems to know anything about it.

    Loginwindow will crash at random times. Sometimes twice a day, sometimes not for a week. I always happens while streaming a video. The video will just stop playing, the sound buttons don’t work, and the forward/back buttons don’t work. Or they don’t seem to. Menu/shutdown didn’t seem to work either. Then a message would come up saying Loginwindow failed. Activity Monitor shows “Loginwindow (fail) in red, or something like that. So I would use the power button to shut down.

    I have since found that if I leave it alone awhile eventually the sound adjust icon will show up and if I wait long enough after selecting Shutdown it will finally shut down. This can take 10-15 minutes.

    Force quit the process has no effect. I see no way to restart it except to restart the computer.

    Any help would certainly be appreciated.

    I have a late 2011 MacBook Pro with OS 10.13.6.

    LikeLiked by 1 person

    • 13
      hoakley's avatar
      hoakley on July 24, 2023 at 2:06 pm

      I’m sorry to hear that.
      I think the only answer can be that something else is causing this and crashing it. It it only happens when streaming a video, use Activity Monitor to identify the processes most active then, and consider them first. It’s then a matter of using something different for your video streaming that doesn’t do this.
      I wish you success.
      Howard.

      LikeLike

·Comments are closed.

Quick Links

  • Free Software Menu
  • System Updates
  • M-series Macs
  • Mac Troubleshooting Summary
  • Mac problem-solving
  • Painting topics
  • Painting
  • Long Reads

Search

Monthly archives

  • January 2026 (7)
  • December 2025 (75)
  • November 2025 (74)
  • October 2025 (75)
  • September 2025 (78)
  • August 2025 (76)
  • July 2025 (77)
  • June 2025 (74)
  • May 2025 (76)
  • April 2025 (73)
  • March 2025 (78)
  • February 2025 (67)
  • January 2025 (75)
  • December 2024 (74)
  • November 2024 (73)
  • October 2024 (78)
  • September 2024 (77)
  • August 2024 (75)
  • July 2024 (77)
  • June 2024 (71)
  • May 2024 (79)
  • April 2024 (75)
  • March 2024 (81)
  • February 2024 (72)
  • January 2024 (78)
  • December 2023 (79)
  • November 2023 (74)
  • October 2023 (77)
  • September 2023 (77)
  • August 2023 (72)
  • July 2023 (79)
  • June 2023 (73)
  • May 2023 (79)
  • April 2023 (73)
  • March 2023 (76)
  • February 2023 (68)
  • January 2023 (74)
  • December 2022 (74)
  • November 2022 (72)
  • October 2022 (76)
  • September 2022 (72)
  • August 2022 (75)
  • July 2022 (76)
  • June 2022 (73)
  • May 2022 (76)
  • April 2022 (71)
  • March 2022 (77)
  • February 2022 (68)
  • January 2022 (77)
  • December 2021 (75)
  • November 2021 (72)
  • October 2021 (75)
  • September 2021 (76)
  • August 2021 (75)
  • July 2021 (75)
  • June 2021 (71)
  • May 2021 (80)
  • April 2021 (79)
  • March 2021 (77)
  • February 2021 (75)
  • January 2021 (75)
  • December 2020 (77)
  • November 2020 (84)
  • October 2020 (81)
  • September 2020 (79)
  • August 2020 (103)
  • July 2020 (81)
  • June 2020 (78)
  • May 2020 (78)
  • April 2020 (81)
  • March 2020 (86)
  • February 2020 (77)
  • January 2020 (86)
  • December 2019 (82)
  • November 2019 (74)
  • October 2019 (89)
  • September 2019 (80)
  • August 2019 (91)
  • July 2019 (95)
  • June 2019 (88)
  • May 2019 (91)
  • April 2019 (79)
  • March 2019 (78)
  • February 2019 (71)
  • January 2019 (69)
  • December 2018 (79)
  • November 2018 (71)
  • October 2018 (78)
  • September 2018 (76)
  • August 2018 (78)
  • July 2018 (76)
  • June 2018 (77)
  • May 2018 (71)
  • April 2018 (67)
  • March 2018 (73)
  • February 2018 (67)
  • January 2018 (83)
  • December 2017 (94)
  • November 2017 (73)
  • October 2017 (86)
  • September 2017 (92)
  • August 2017 (69)
  • July 2017 (81)
  • June 2017 (76)
  • May 2017 (90)
  • April 2017 (76)
  • March 2017 (79)
  • February 2017 (65)
  • January 2017 (76)
  • December 2016 (75)
  • November 2016 (68)
  • October 2016 (76)
  • September 2016 (78)
  • August 2016 (70)
  • July 2016 (74)
  • June 2016 (66)
  • May 2016 (71)
  • April 2016 (67)
  • March 2016 (71)
  • February 2016 (68)
  • January 2016 (90)
  • December 2015 (96)
  • November 2015 (103)
  • October 2015 (119)
  • September 2015 (115)
  • August 2015 (117)
  • July 2015 (117)
  • June 2015 (105)
  • May 2015 (111)
  • April 2015 (119)
  • March 2015 (69)
  • February 2015 (54)
  • January 2015 (39)

Tags

APFS Apple Apple silicon backup Big Sur Blake Bonnard bug Catalina Consolation Console Corinth Delacroix Disk Utility Doré El Capitan extended attributes Finder firmware Gatekeeper Gérôme High Sierra history of painting iCloud Impressionism landscape LockRattler log M1 Mac Mac history macOS macOS 10.12 macOS 10.13 macOS 10.14 macOS 10.15 macOS 11 macOS 12 macOS 13 macOS 14 macOS 15 malware Metamorphoses Mojave Monet Monterey Moreau myth narrative OS X Ovid painting performance Pissarro Poussin privacy Renoir riddle Rubens Sargent security Sierra SilentKnight Sonoma SSD Swift Time Machine Tintoretto Turner update upgrade Ventura xattr Xcode XProtect

Statistics

  • 21,118,573 hits
Blog at WordPress.com.
Footer navigation
  • Free Software Menu
  • About & Contact
  • Macs
  • Painting
  • Downloads
  • Mac problem-solving
  • Extended attributes (xattrs)
  • Painting topics
  • SilentKnight, Skint, SystHist, silnite, LockRattler & Scrub
  • DelightEd & Podofyllin
  • xattred, SpotTest, Spotcord, Metamer & xattr tools
  • 32-bitCheck & ArchiChect
  • XProCheck, T2M2, LogUI, Ulbow, blowhole and log utilities
  • Cirrus & Bailiff
  • Precize, Alifix, UTIutility, Sparsity, alisma, Taccy, Signet
  • Versatility & Revisionist
  • Text Utilities: Textovert, Nalaprop, Dystextia and others
  • PDF
  • Keychains & Permissions
  • Updates
  • Spundle, Cormorant, Stibium, DropSum, Dintch, Fintch and cintch
  • Long Reads
  • Mac Troubleshooting Summary
  • M-series Macs
  • Mints: a multifunction utility
  • VisualLookUpTest
  • Virtualisation on Apple silicon
  • System Updates
  • Saturday Mac Riddles
  • Last Week on My Mac
  • sysctl information
Secondary navigation
  • Search

Post navigation

Reading visual art: 44 What’s wrong in that painting? 2
Saturday Mac riddles 195

Begin typing your search above and press return to search. Press Esc to cancel.

  • Reblog
  • Subscribe Subscribed
    • The Eclectic Light Company
    • Join 8,899 other subscribers
    • Already have a WordPress.com account? Log in now.
    • The Eclectic Light Company
    • Subscribe Subscribed
    • Sign up
    • Log in
    • Copy shortlink
    • Report this content
    • View post in Reader
    • Manage subscriptions
    • Collapse this bar
%d