dc

Ubuntu’s “service freeradius reload” failure

Recently I had to upgrade a server from a Debian 4 to Ubuntu 14.04LTS. One of the problems I encountered was that freeradius behaved badly when I ran service freeradius reload. Mainly, I would end up with a lot of failed binding logs, because upstart had no clue how to reload the process. It turns out that that upstart script is misconfigured.

Below is how I have it configured, and it works as expected

1# freeradius -- Radius server
2#
3 
4description "Extensible, configurable radius daemon"
5author "Michael Vogt <mvo@ubuntu.com>"
6 
7start on runlevel [2345]
8stop on runlevel [!2345]
9 
10respawn
11 
12expect fork
13 
14script
15  if [ -r /etc/default/freeradius ]; then
16    . /etc/default/freeradius
17  fi
18  exec /usr/sbin/freeradius $FREERADIUS_OPTIONS
19end script
20 
21pre-start script
22  # /var/run may be a tmpfs
23  if [ ! -d /var/run/freeradius ]; then
24    mkdir -p /var/run/freeradius
25    chown freerad:freerad /var/run/freeradius
26  fi
27end script

Disclaimer I am a FreeBSD user, things are simple there

The primary changes are expect fork and the removal of -f from the /usr/sbin/freeradius line.

“How would the package maintainers not configure the init script for upstart correctly?” is the question you are asking. I’m fairly certain that it is deliberate. The php5-fpm init script is also setup for --nodaemonize and I think they messed that one up to.

Hopefully this helps someone else out who is trying to run service freeradius reload

Leave a reply