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

# freeradius -- Radius server
#

description "Extensible, configurable radius daemon"
author "Michael Vogt <mvo@ubuntu.com>"

start on runlevel [2345]
stop on runlevel [!2345]

respawn

expect fork

script
  if [ -r /etc/default/freeradius ]; then
    . /etc/default/freeradius
  fi
  exec /usr/sbin/freeradius $FREERADIUS_OPTIONS
end script

pre-start script
  # /var/run may be a tmpfs
  if [ ! -d /var/run/freeradius ]; then
    mkdir -p /var/run/freeradius
    chown freerad:freerad /var/run/freeradius
  fi
end 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