[launchd-dev] Attempting to develop a launch plist for sysmon

Morgan Aldridge morgant at makkintosshu.com
Fri Aug 1 15:09:03 PDT 2008


A few years ago I wrote a Mac OS X StartupItem for sysmon
<http://www.sysmon.org/> and I've been attempting to write a launchd
plist for it now that I've migrated my monitoring server to Leopard
Server (currently 10.5.3).

Here's my /Library/LaunchDaemons/com.makkintosshu.sysmon.plist (owned
by root:wheel with permissions of 750):

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN"
"http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
        <dict>
                <key>Label</key>
                <string>com.makkintosshu.sysmon</string>
                <key>ProgramArguments</key>
                <array>
                        <string>/usr/local/bin/sysmond</string>
                        <string>-d</string>
                </array>
                <key>OnDemand</key>
                <false/>
                <key>KeepAlive</key>
                <true/>
                <key>RunAtLoad</key>
                <true/>
        </dict>
</plist>

I use both the OnDemand and KeepAlive keys in the hopes of supporting
both Tiger & Leopard with this file. Will I run into any issues there
(I've currently only tested with Leopard Server)?

Also, it seems to work correctly (sysmond loads, loads it's config
file, and binds to its TCP port fine; plus if you kill the process
launchd starts it up again) if I run `sudo launchctl load -w
/Library/LaunchDaemons/com.makkintosshu.sysmon.plist` after boot, but
if I leave it loaded (or, at least, if I don't disable it using `sudo
launchctl unload -w
/Library/LaunchDaemons/com.makkintosshu.sysmon.plist`) at boot,
sysmond acts as if it didn't have any config files to load and it
usually takes an unload & load of the launchd plist to get it to
function normally.

Any ideas as to what might cause this? Will I have to start
investigating sysmond's source to see if it's a dependency checking
issue? Shouldn't the file system be available upon loading the job and
only network services might be unavailable?

Thanks in advance,

Morgan Aldridge
---
morgant at makkintosshu.com
http://www.makkintosshu.com/


More information about the launchd-dev mailing list