/etc/init.d/freeradius stop don't work

Bug #407324 reported by luk156
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
freeradius (Ubuntu)
Fix Released
Undecided
Chuck Short
Hardy
Fix Released
Undecided
Chuck Short

Bug Description

* Stopping FreeRADIUS daemon freeradius
* /var/run/freeradius/freeradius.pid not found... [ OK ]

infact the pid is in /var/run/radiusd/radiusd.pid

Revision history for this message
Andreas Olsson (andol) wrote :

Sounds a lot like bug #367769. Which version of FreeRADIUS are you running in what release of Ubuntu?

Changed in freeradius (Ubuntu):
status: New → Incomplete
Revision history for this message
luk156 (lucchesimatteo) wrote :

freeradius -v
freeradius: FreeRADIUS Version 2.1.0, for host i486-pc-linux-gnu, built on Mar 5 2009 at 18:50:47

cat /etc/apt/sources.list
deb http://archive.ubuntu.com/ubuntu jaunty main universe
deb http://security.ubuntu.com/ubuntu jaunty-security main

Revision history for this message
Andreas Olsson (andol) wrote :

Wouldn't mind also getting the actually package versions.

$ apt-cache policy freeradius

Revision history for this message
luk156 (lucchesimatteo) wrote :

apt-cache policy freeradius
freeradius:
  Installato: 2.1.0+dfsg-0ubuntu4
  Candidato: 2.1.0+dfsg-0ubuntu4
  Tabella versione:
 *** 2.1.0+dfsg-0ubuntu4 0
        500 http://archive.ubuntu.com jaunty/main Packages
        100 /var/lib/dpkg/status

Revision history for this message
Andreas Olsson (andol) wrote :

Sorry about being picky about the package version number. I just wanted to be sure that there were no (other) issue preventing you from getting the most recent package.

A fresh install of freeradius 2.1.0+dfsg-0ubuntu4, in which above mentioned pid issue is fixed, will give you a /etc/freeradius/radiusd.conf including these two lines

  run_dir = ${localstatedir}/run/freeradius
  pidfile = ${run_dir}/freeradius.pid

Is it possible that your /etc/freeradius/radiusd.conf instead till have these old values

  run_dir = ${localstatedir}/run/radiusd
  pidfile = ${run_dir}/radiusd.pid

If so, do you have any memory of during an upgrade deciding to keep parts of your old /etc/freeradius/radiusd.conf?

Revision history for this message
Chuck Short (zulcss) wrote :

This should already be fixed for karmic.

Regards
chuck

Changed in freeradius (Ubuntu):
status: Incomplete → Fix Released
Chuck Short (zulcss)
Changed in freeradius (Ubuntu):
assignee: nobody → Chuck Short (zulcss)
Chuck Short (zulcss)
Changed in freeradius (Ubuntu Hardy):
assignee: nobody → Chuck Short (zulcss)
Revision history for this message
Chuck Short (zulcss) wrote :

This is fixed for hardy.

Changed in freeradius (Ubuntu Hardy):
status: New → Fix Committed
Chuck Short (zulcss)
Changed in freeradius (Ubuntu Hardy):
status: Fix Committed → Fix Released
Revision history for this message
Btown801 (brandonborchert) wrote :

USE THE COMMAND: "service freeradius stop". I looked through several forums searching for how to kill freeradius on ubuntu. how to stop freeradius. how to turn off freeradius. All because I was getting an error that said freeradius port 1812 was in use. Spent a few hours searching and found nothing. Hopefully this post will save someone some time! Enjoy! :)

Revision history for this message
Patrick (9-patrick-4) wrote :

I found this is an issue with the .pid file even if you restart it the process id is still the same number and I get loads of errors such as port in use. I modified the files listed below to get it working but the service freeradius stop or restart command still does not work im on 14.04.3.

/etc/init.d/freeradius

# freeradius -- Radius server
#

description "Extensible, configurable radius daemon"
author "Michael Vogt <email address hidden>"

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

umask 002 - add

respawn

#pre-start script - comment out
# if [ -r /etc/default/freeradius ]; then - comment out
# . /etc/default/freeradius - comment out
# fi - comment out
# exec /usr/sbin/freeradius -f $FREERADIUS_OPTIONS - comment out
#end script - comment out

pre-start script - add
if [ -x /var/run/freeradius/freeradius.pid ]; then - add
 rm -rf /var/run/freeradius/freeradius.pid - add
fi - add

if [ ! -d /var/run/freeradius ]; then - add
  mkdir -p /var/run/freeradius - add
  chown freerad:freerad /var/run/freeradius - add
  chmod 775 /var/run/freeradius - add
fi - add
end script - add

/etc/init/freeradius

umask 002 - add

. /lib/lsb/init-functions

PROG="freeradius"
PROGRAM="/usr/sbin/freeradius"
PIDFILE="/var/run/freeradius/freeradius.pid"
DESCR="FreeRADIUS daemon"

if [ -r /etc/default/$PROG ]; then
  . /etc/default/$PROG
fi

test -f $PROGRAM || exit 0

# /var/run may be a tmpfs - comment out
# if [ ! -d /var/run/freeradius ]; then - comment out
# mkdir -p /var/run/freeradius - comment out
# chown freerad:freerad /var/run/freeradius - comment out
# chmod 775 /var/run/freeradius - comment out
# fi - comment out

Revision history for this message
Ping-Pong (pingpong2012) wrote :

I'm running Ubuntu 14.04 x86 on kernel 4.2.0-27-generic (I think) and I'm getting this, and more bugs while using SSH (seems to be the big culprit)

The version of Freerad is 2.1.12+dfsg-1/2ubuntu8. I had to install a bunch of packages off-line (I'm on an internal network), but sudo apt-get install -f shows no issues, and I followed all the packages I should need from various tutorials (including the official).

The first is stopping the service is really erratic. The service seems to run fine at boot, but I want to run freeradius -X of course. Running with -X binds the terminal, so I open another which works with radtest, but if I do sudo service freeradius stop I get:

stop: Unknown Instance:

I can see the process running in ps aux | grep freeradius, and that freerad is the user, as normal.

In service --status-all I get [ ? ] freeradius

If I try sudo /etc/init.d/freeradius stop I get:

 * Stopping FreeRADIUS daemon freeradius
 * /var/run/freeradius/freeradius.pid not found... [OK]

I have made the file multiple times, and changed the owner to freerad:freerad. The debug output from terminal 1 shows it is properly being located during config, but it doesn't get "instantiated" (I saw from some older forums that missing files get instantiated in older versions).

On the terminal that has the server running, I can ctrl-c and stop and start the server no problem. However, if the server is running in terminal 1 and in terminal 2 I do a killall, the terminal even goes from "Ready to process requests" to "Signalled to terminate Exiting Normally." but the service is now unresponsive, and doesn't respond to anything.

After typing this post, the service freed itself and is now working normally, and I don't understand why. It seems the problem is intermittent or otherwise happens during a specific situation.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.