Rein in an out of control servermgrd process

Mac OS X Add comments

I have two Tiger servers that have a problem, and I’ve seen that others have a similar problem on the Apple Mac OS X Server discussions forum. Over the course of some number of days, the servermgrd process seems to spin out of control, gradually eating more and more CPU time until it starts to affect the responsiveness of the server. Not all Tiger servers seem to have this problem, but for those that do, there’s a simple fix.

The only way to stop servermgrd from growing is to hang it up and let it restart. That can be done manually, but with just a tad bit more work, it can be done automatically. In my particular instance, as I stated before, the problem happens over a series of days. That makes it prudent to hang up the servermgrd process weekly. To do this, we’ll add a supplemental script that runs during the normal weekly periodic maintenance job.

At the end of the /etc/periodic/weekly/500.weekly script, another script called /etc/weekly.local is called if it exists. We’re going to create that script and write a simple command to hang up servermgrd.

First, let’s create the script as root and edit it.

sudo nano /etc/weekly.local

The script consists of a single line. Paste this command into your Terminal window or type it:

killall -HUP servermgrd

The killall command is used to stop running processes by name, and the -HUP option restarts a process after stopping it.

Press control-x to exit nano and save the script. Since we used sudo to edit the script as root, the owner and group should already be correct (root:wheel). We need to set permissions correctly so the script is executable, and so other users don’t mess with it.

sudo chmod 744 /etc/weekly.local

The next time the weekly periodic script is run, servermgrd will be restarted.

One Response to “Rein in an out of control servermgrd process”

  1. Aaron Adams Says:

    PS - If you need to hang up servermgrd daily, change “weekly.local” in each line above to “daily.local”. This will hang up servermgrd each morning at 3:15 when the com.apple.periodic-daily launchd item is run.

Leave a Reply

WP Theme & Icons by N.Design Studio
Entries RSS Comments RSS Log in