6.7 Monitoring FreeRADIUS

Part of proactive system administration is monitoring for problems before they occur. While you, as the administrator, are probably at your office and within reach of the RADIUS server for 8-12 hours a day, the remaining hours aren't devoid of users who depend on your service. What happens when (not if) your FreeRADIUS server has a problem and you're not around?

This section describes using some freely available tools to set up FreeRADIUS such that if it happens to shut down because of an error, it automatically restarts. While it's still your responsibility to troubleshoot the problem, it does recover the service so you don't have to deal with angry users calling because they can't get on the Internet.

Let's use Dan Bernstein's DaemonTools package, and in particular, its "supervise" service to monitor radiusd . To get started, surf to the DaemonTools web site at http://cr.yp.to/daemontools.html, download the package, and install it. Dan has complete installation instructions on his site as well as a good deal more documentation that outlines and details the capabilities of DaemonTools. That's beyond the scope of this application, but it's likely you can find a use for some of the service management that DaemonTools provides.

Once the tools are installed, you need to create a RADIUS service directory that DaemonTools can use. It's common practice to place this directory on the /var partition in the svc directory, although it can be placed anywhere you choose. For the rest of this section, I'll assume you chose the /var/svc/radiusd directory. Make the directories, and then open up your favorite text editor.

In the text editor, you need to create a simple shell script, called run , that will call up radiusd in the event it fails. Here's a sample:

 #!/bin/sh exec /usr/local/sbin/radiusd -s -f 

Of course, replace these directories with ones appropriate for your machine as needed. The -f flag is important in this case; it tells FreeRADIUS to stay on the console screen and not return to a command prompt. If it detaches itself, DaemonTools will think it died and attempt to restart it using the shell script provided above.

Now, make that script executable:

 chmod +x /var/svc/radiusd/run 

Finally, tell DaemonTools to watch FreeRADIUS.

 Supervise /var/svc/radiusd. 

DaemonTools is now setup and will restart radiusd upon its death.

Table 6-7 lists additional maintenance commands, available from the DaemonTools svc utility, that you will likely find useful.

Table 6-7. FreeRADIUS service management commands

Action

Command

To shut down FreeRADIUS normally

 svc -d /var/svc/radiusd 

To restart FreeRADIUS

 svc -u /var/svc/radiusd 

To kill FreeRADIUS (send a HUP)

 svc -h /var/svc/radiusd 

To shut down and stop monitoring

 svc -dx /var/svc/radiusd 


Radius
Radius
ISBN: 0596003226
EAN: 2147483647
Year: 2005
Pages: 89

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net