Launchd Jobs

From radmind

Jump to: navigation, search

Contents

[edit] Overview

A list of sample jobs for radmind admins to have a starting point

[edit] Jobs

[edit] launchd job to start a Radmind server instance

The following is a basic example of a Launchd job that will start a Radmind server instance. Several of the "radmind" tool's command line options have been specified in the ProgramArguments array to demonstrate how to list them.

<?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>edu.umich.radmindserver</string>
        <key>ProgramArguments</key>
        <array>
                <string>/usr/local/sbin/radmind</string>
                 <string>-u</string>
                 <string>077</string>
                 <string>-p</string>
                 <string>6222</string>
                 <string>-w</string>
                 <string>0</string>
                 <string>-x</string>
                 <string>/custom/path/to/ca.pem</string>
                 <string>-y</string>
                 <string>/custom/path/to/cert.pem</string>
                 <string>-z</string>
                 <string>/custom/path/to/cert.pem</string>
        </array>
        <key>RunAtLoad</key>
        <true/>
</dict>
</plist>

This server plist could be saved as /Library/LaunchDaemons/edu.umich.radmindserver.plist.

Multiple Launchd jobs could then be created to start up the server in various configurations, such as to provide a combination of ports (-p), authorization levels (-w), certificates (-x, -y, -z), compression levels (-Z). This would allow one physical or virtual Radmind server to support multiple server configurations, such as basic servers with -w0 authorization on one port (perhaps the default 6222 and legacy 6662), and -w1 and -w2 on other ports.

There are some other options to consider for the server. Ideally in a dynamic Launchd environment, any given Radmind server instance would be started only when it is needed (i.e. when a client connects), but in the example above, RunAtLoad starts the server when the system boots up and keeps it running thereafter.

Also, consider other launchd.plist keys. The OnDemand key is used by Mac OS X 10.4 but is deprecated thereafter. The NetworkState key is used on Mac OS X 10.5 and later, and in the example will keep the job running while the network stack is loaded. The UserName key could be used enable the Radmind server to run as a less-privileged non-root user. A LimitLoadToHosts array could define which hosts could run the Radmind server jobs. RootDirectory could potentially be used to chroot the Radmind server processes.

[edit] launchd job based on calendar time for radminding

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
	<key>Label</key>
	<string>edu.umich.radmindclient</string>
	<key>ProgramArguments</key>
	<array>
		<string>/usr/bin/ra.sh</string>
		<string>-h</string>
		<string>radmind.server</string>
		<string>-c</string>
		<string>-r</string>
		<string>/</string>
		<string>auto</string>
	</array>
</dict>
</plist>

Change 'radmind.server' to your radmind server.

[edit] To Do

  • launchd job based on time interval for radminding
  • launchd job for updating radmind-related tools (administrator defined)
  • launchd job based on notification file for user-requested radminding
  • launchd job based on SystemConfiguration events (specified events in a plist)

[edit] Sections

Mac OS X ToolBox

Personal tools