Enable/disable startup programs/script/services on a Mac

11

16

I upgraded my MacBook Pro to OS X Lion, and now the fans are working at high speed, even at very low loads.

I did a lot of things, resetting PRAM, SMC, etc, but the problem persists. It seems it has to do with Parallels or some other application.

I wonder how could I find out which programs/scripts/services are started at reboot on my MacBook. I'm not talking about just going to User Accounts in System Preferences. I mean the full list, like the one you get in a Linux machine.

Open the way

Posted 2011-09-12T09:27:50.280

Reputation: 6 061

"I mean the full list, like the one you get in a linux machine" -- I have yet to see something like that. Any such list will be incomplete. – Daniel Beck – 2011-09-12T11:28:32.607

2flow, please make up your mind whether this is a troubleshooting question or you're asking about automatically starting programs. As it stands, it's a bit of both and really difficult to answer. I'm actually tempted to delete the first two paragraphs... – Daniel Beck – 2011-09-12T11:35:07.150

A pretty classic XY question IMHO. – bmike – 2011-09-13T15:30:12.317

Answers

21

Seeing which processes are running

  1. From the Terminal, using ps ax
  2. Run Applications » Utilities » Activity Monitor and select All Processes. You can also exit them from there.

Automatically starting processes

  1. Those that are selected to Open at Login in the Dock
  2. Those in System Preferences » Accounts » Login Items (actually, these include the ones from 1.)
  3. The login hook for loginwindow described here, read current value with defaults read com.apple.loginwindow LoginHook
  4. Some of those specified as part of a launchd script (or otherwise managed by launchd). List all with sudo launchctl list. See man launchctl for details.

Regarding the launchd lists, you can see their definition files in the LaunchAgents and LaunchDaemons subdirectories of your system's Library directories:

  • /System/Library (you probably shouldn't touch these)
  • /Library/ (usually for all users)
  • /Users/yourname/Library (your own programs)

In the latter two libraries, check for anything suspicious. It's usually XML, so you can open and read them.


The problem here is, that you can run a single process that launches tons of others upon a certain condition, e.g. cron on OS X exists but is deactivated by default. Specify @reboot for a job, and it will be launched by cron upon system start.

Something similar applies to your shell configuration files .bash_profile etc., that can launch processes in the background as soon as you open Terminal.

Daniel Beck

Posted 2011-09-12T09:27:50.280

Reputation: 98 421

Does LoginHook still exist? I get the following error when trying to read the value: The domain/default pair of (/Users/[username]/Library/Preferences/com.apple.loginwindow, LoginHook) does not exist – Pieter – 2016-04-01T08:35:03.213

Also check /Library/LaunchAgents and /Library/LaunchDaemons/ – Matt Sephton – 2017-12-13T10:34:06.257

sorry, I mean; there are some other programs and services that are started at boottime (do not know exactly when) like parallels, but they do not appear on those files – Open the way – 2011-09-12T15:55:27.167

last comment; I notice that booting into safe mode, I have no problem at all, so it might be that something is loaded into normal mode that causes this problem. How could I do some find of "diff" to know this? – Open the way – 2011-09-12T16:07:03.803

@flow Parallels is likely a kernel extension in /System/Library/Extensions. Command line tool names for handling those start with kext. – Daniel Beck – 2011-09-12T16:31:49.227

@flow I don't mind constructive comments, no matter how many. – Daniel Beck – 2011-09-12T16:32:18.430