Blog |Follow Nick on Twitter| About
 

Inspired by this, but better ;)

So now I have got mediatomb working, I've started on my own StartupItem so that it loads at boot time. The reason it is better is because you can start and stop mediatomb via launchctl.

I saved the below (the more) as /Library/LaunchDaemons/com.linickx.mediatomb.plist.

To start:

sudo launchctl load /Library/LaunchDaemons/com.linickx.mediatomb.plist

To stop:

sudo launchctl unload /Library/LaunchDaemons/com.linickx.mediatomb.plist

Happy Days!

<?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.linickx.mediatomb</string>
    <key>ProgramArguments</key>
    <array> 
        <string>/usr/local/bin/mediatomb</string>
        <string>-e</string>
        <string>en0</string>
        <string>-P</string>
        <string>/Users/nick/.mediatomb/mediatomb.pid</string>
        <string>-p</string>
        <string>49152</string>
    </array>
    <key>UserName</key>
    <string>nick</string>
    <key>ServiceDescription</key>
    <string>Run MediaTomb at boot</string>
    <key>RunAtLoad</key>
    <true/>
    <key>Nice</key>
    <integer>20</integer>
    <key>KeepAlive</key>
    <true/>
    <key>StandardErrorPath</key>
    <string>/Users/nick/.mediatomb/error.log</string>
    <key>StandardOutPath</key>
    <string>/Users/nick/.mediatomb/output.log</string>
</dict>
</plist>

rgds,

Nick

 
Nick Bettison ©