Comment 6 for bug 1406105

Revision history for this message
Robert C Jennings (rcj) wrote :

Here is a debdiff to show how we can manage the process properly in an upstart job (missing exec) so that a restart or reload works as we would expect. The patch also fixes the logrotate script to use the upstart controls rather than the systemv init script (which should not have been shipped because it isn't used on Trusty).

Prior to this patch you can't restart/reload the process because the process isn't properly managed by upstart and logrotate's reload of freeradius was a no-op. With this patch, logstart will properly call 'service freeradius reload', ignoring failure due to the service not running.

Package upgrade is a problem.... Is there a way to fix the management of a running freeradius process on a user's system when this package is updated? We would not want to perform an unexpected restart of the service and without this fix reloading the service won't work (nor will the restart because it kills the shell that start the freeradius process but not the freeradius process itself). However, having the upgraded package on the system won't make the current situation any worse and will resolve the issue on the first reboot (or manually killing freeradius and starting again).

Best I know that we can do is put the fix in place and it will be available after a restart; having the upgraded package on the system won't make the current situation any worse but it won't fix the issue prior to a restart or some manual intervention to clean up the unmanaged freeradius process.

To illustrate the current process problem:
 1 - Install freeradius on trusty
 2 - Run 'start freeradius'
 3 - Get the PID upstart is using for freeradius with 'status freeradius'
 4 - Check ps for that PID
    (e.g. if PID is 1023 run 'ps -ef | grep 1023 | grep -v grep'. Upstart job PID will map to /bin/sh, the parent of freeradius)
 5 - Run 'reload freeradius'.
      Expect success, exit 0 and freeradius is still running (SIGHUP was not delivered, check with a shim if you like)
 6 - Run 'status freeradius' .
      Results in "freeradius stop/waiting" because the parent shell script died when it received HUP but freeradius is still running.
 7 - Run 'ps -ef |grep freeradius'.
      Expect freeradius still running (same PID as step 4 but PPID is now init)
      This process isn't tracked by upstart now. You can't 'start freeradius' because the new process will exit upon failing to open the port already opened by the untracked freeradius.