Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

cgscotto

macrumors member
Original poster
Sep 29, 2018
70
31
Athens, OH
I was on the phone with Apple Support for two hours without resolving the issue.
First, background:
Recently, when I started my Mac Studio (13.2), the terminal app opened with the message that my default shell should be /bin/zsh rather than /bin/bash, which was the default shell for Catalina and earlier. The command to execute the change was pretty simple: chsh -s /bin/zsh (I should note that Apple's own documentation lists the command as $ chsh -s /bin/zsh, but terminal listed it without the $, I tried it is listed on the webpage, but terminal said it was an unrecognized command. https://support.apple.com/en-us/HT208050). The command executed fine, and my shell is not zsh.

Problem
It may be a coincidence, but now every time I restart my Mac Studio System Settings and terminal open as if they are listed as login items in my user name, which they are not. System Settings always opens with Appearance selected.

Does anybody know how I can make System Settings and terminal not open on every restart?

Thanks in advance.
 
After a restart and Terminal window appears, does it just contain the prompt or does it contain more text, as if commands have been executed? If more than just the prompt, can you paste the text from the Terminal window or take a screenshot?

The next is a little involved but the System Settings is not the only place where programs can be set to run automatically on startup/login. In the Terminal window, run this command (you will need to be administrator and have your password).

Bash:
sudo launchctl list | grep -v apple

The 'launchctl list' command will list out all installed "launch at start up" program configurations. It's long and mostly contains Apple programs. The "grep" part at the end filters out the Apple programs and leaves only the non-Apple programs in the list. Run this and paste the results. Let's see if we can determine what is starting up.
 
The 'launchctl list' command will list out all installed "launch at start up" program configurations.

A bit easier to read if you sort the list:

sudo launchctl list | grep -v apple | sort +2
 
Hi, and thanks for replying. I ran the command and have a list, but before I paste it in I have some additional information. First, when Terminal starts it shows the last login message followed by the prompt as if waiting for a command. Second, if I startup in Safe Mode, the problem does not occur. I should also add that System Settings also opens on every startup, both terminal and System Settings appear, but starting in Safe Mode startup is normal and they both do not launch. I tried removing all the Login items I added one at a time and restarting, but that did not change anything. I also started up with all peripherals unplugged from the Mac Studio. Same problem. H

I ran the command, and here is the list it returned:
PID Status Label


752 0 application.com.getdropbox.dropbox.1902975.28285018


773 0 application.com.hegenberg.BTTRelaunch.38061796.38061802


744 0 application.com.hegenberg.BetterTouchTool.38061299.38061305


536 0 application.com.microsoft.Outlook.27412256.27468208


755 0 application.com.native-instruments.NIHostIntegrationAgent.24004541.24004547


756 0 application.com.uaudio.console2.43852593.43852598


782 0 application.com.uaudio.ua-cloud-helper.46692975.46693079


761 0 application.com.uaudio.ua-connect.46692631.46693086


769 0 application.com.uaudio.ua_mixer_engine.43852183.43852188


754 0 application.fr.madrau.switchresx.daemon.37635674.37635679


728 0 com.avid.link


714 0 com.bitdefender.antivirusformac


729 0 com.bjango.istatmenus.agent


737 0 com.bjango.istatmenus.status


- 0 com.dropbox.DropboxMacUpdate.agent


727 0 com.epson.Epson_Low_Ink_Reminder.launcher


- -11 com.epson.ecrp.launcher.plist


- 0 com.epson.esua.launcher


681 0 com.epson.eventmanager.agent


722 0 com.epson.scannermonitor


- 1 com.google.keystone.user.agent


- 0 com.google.keystone.user.xpcservice


734 0 com.logi.cp-dev-mgr


- 0 com.microsoft.OneDriveStandaloneUpdater


- 0 com.microsoft.update.agent


723 0 com.nektony.App-Cleaner-SIII-Helper


- 0 com.openssh.ssh-agent


- 0 com.paceap.eden.licensed.agent


- 0 com.rogueamoeba.loopbackd


- 0 com.uaudio.ua_mixer_engine


719 0 com.uaudio.uad-meter


730 0 com.waves.wls


- 0 org.cindori.SenseiMonitor

I recognize everything on the list, except com.openssh.ssh-agent, which seems related to Terminal because of the open shell part.

EDIT: I just looked that up and it seems to be a normal Apple file for remote login for me. The permissions on the file only allow system write access.

Thanks in advance for the help.
 
Last edited:
If Safe Mode doesn't show the problem, what about a bare test user?

If a test user doesn't show the problem then it is something in your configuration.

You mentioned that you removed all of the login items. In that case sudo launchctl list | grep -v apple | sort +2 listed nothing, i.e., was blank?
 
Thanks for the replies.
Just to be clear, Systems Settings and Terminal are automatically launching when starting up or restarting.
To verify the information, I restarted in Safemode. Neither System Settings nor Terminal launched. How would Safe Mode show me the problem? Where would I look while in Safe Mode to see the problem?
I created a test account. When I logged off my account and logged into the test account neither program launched.
When I logged off the test account into my account neither program launched. However, when I restarted both programs launched.
When I restarted and logged into the test account neither program launched.
I once again removed all items from Login, and the problem persisted.
The test user account had the same items in the Run In Background as my account.
The items in ~/Library/LaunchAgents, /Library/LaunchAgents or /Library/LaunchDaemons both accounts are same since I always install software for all users.

Would the process now be to remove all the items from the above folders and add them in one at a time? As always, thanks for your help.
 
Not to find malware, but to point out what is launching System Settings & Terminal.
 
OK, that makes sense, but where would I find that information. The logical place would be in the Launch Items category. However, I do not see any Launch Daemons that specifically launch either terminal or system settings. They're a bunch of exec files. Would those be candidates for triggering Terminal or System Settings to launch?
 
I looked at all the plist files in Launch Agents and Launch Daemons, which are all the files listed in System Settings. None of them had a string that instructed Terminal to launch at load. The closest thing to Terminal I found was this:
<key>Authorization</key>
<string>Unix</string>

Thanks.
 
Last edited:
Any result from
Code:
grep -ilR terminal ~/Library/LaunchAgents /Library/Launch*
or
Code:
grep -ilR system ~/Library/LaunchAgents /Library/Launch*
 
The first one returned no such file or directory and the second command gave me the Man page for the command. I am not sure I typed it correctly because I am not sure of the character between -i and R. Is it a capitol L or 1?
 
OK, the first command returned nothing, but the second command returned a few items:

/Library/LaunchAgents/com.logi.optionsplus.plist

/Library/LaunchDaemons/com.waves.central.InstlHelper.plist

/Library/LaunchDaemons/com.logi.optionsplus.updater.plist
 
OK, I get what you are looking for. Here are the instances of System. Would any of them open system preferences?

<key>SYSTEM_VERSION_COMPAT</key>

<key>NSSystemAdministrationUsageDescription</key>

<key>SYSTEM_VERSION_COMPAT</key>
 
Would any of them open system preferences?
Unfortunately, no.
I can't think of anything else then deleting all and adding them back one by one.
You can seize the opportunity to clean up ~/Library/LaunchAgents, /Library/LaunchAgents and /Library/LaunchDaemons :)
Good luck!
 
Thanks for the help. I have been cleaning them up as I go along. I really appreciate the effort. If this get too annoying, I may just reinstall the system. Thanks again.
 
Well, I am starting to believe this is a bug in Ventura. I reinstalled the system software and the problem persists. Actually, I did not notice before that three application are launching at startup: Preview, System Settings, and Terminal. I was focused on Terminal and System Settings. Now, I can remove an application from Login items, say Microsoft Outlook, and it still opens at login.

I really think this started when Terminal automatically opened after a startup requesting that I change shells. Somehow they are now stuck as login items. I did find this poking around the net about an early bug in Ventura:

"LaunchAgents and LaunchDaemons (in both /Library and ~/Library) are now managed from the System Settings, General, Login Items pane. They are the items under "Allow in the Background". If you fully uninstall an app, removing its Library items, they will remain in Login Items forever. I suspect this is by design. Otherwise, a malicious app could defeat having its background item disabled by removing it and putting it back.

It took a bit of digging with fs_usage to figure out where Login Items tracks background items. If you really want to clean that list up, you have to boot to recovery mode, mount the Data volume, and delete /private/var/db/com.apple.backgroundtaskmanagement/BackgroundItems-v4.btm

This file used to be in ~/Library/Application Support/com.apple.backgroundtaskmanagementagent/ but it was too easy for malware to modify it as it was owned by the user. Apple has moved it to a location that cannot be accessed, even by root, while macOS is running."

I am not going to attempt that solution. The next step, I guess, will be clean install and reinstall my items from backup. Or just wait until the point update of Ventura to see if Apple fixes the problem. I will have to wait until my work reaches a point where the clean install won't be disruptive. I guess I also try a clean install on another disc.

Once I have time to do any of these options, I will report back. Thanks for the help.
 
Go to the icon in the dock, Rt click (Cntrl/LftClick) and under 'Options' disable 'Open at login'.
 
Go to the icon in the dock, Rt click (Cntrl/LftClick) and under 'Options' disable 'Open at login'.
That is the same as removing from System Settings - General - Login Items

@cgscotto I’ve remembered an old issue with the last accessed apps not being properly cleared from the ~/Library/Preferences/ByHost/com.apple.loginwindow plist
Try to quit all open apps, wait a minute, reboot making sure that “Reopen windows when logging back in” is not checked.
 
  • Like
Reactions: allan.nyholm
Thanks Ruggy, but that was one of the first things I tired. I even turned off "show most recent apps" in the dock settings.

bogdanw, I was so hoping that would work, but when I restarted all three culprits were still there, system settings, terminal, and preview. Can ~/Library/Preferences/ByHost/com.apple.loginwindow plist be deleted? Won't the system create new one upon restart?
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.