# freeradius not starting via init script

## myha

Hi,

I just updated the freeradius to latest version and I cannot start it anmore via init script...

Here is what I get:

```

server ~ # /etc/init.d/radiusd start

 * Starting radiusd ...

radiusd: Error: No log destination specified.                                                                                                                                                     [ !! ]

server ~ # 

```

via 

```
/etc/raddb/radiusd -X
```

 it works fine...

here is the output of radiusd -X:

```

server raddb # radiusd -X

FreeRADIUS Version 2.0.5, for host i686-pc-linux-gnu, built on Aug 26 2008 at 13:57:07

Copyright (C) 1999-2008 The FreeRADIUS server project and contributors. 

There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A 

PARTICULAR PURPOSE. 

You may redistribute copies of FreeRADIUS under the terms of the 

GNU General Public License v2. 

Starting - reading configuration files ...

including configuration file /etc/raddb/radiusd.conf

including configuration file /etc/raddb/proxy.conf

including configuration file /etc/raddb/clients.conf

including configuration file /etc/raddb/snmp.conf

including configuration file /etc/raddb/sql.conf

group = radiusd

user = radiusd

including dictionary file /etc/raddb/dictionary

main {

   prefix = "/usr"

   localstatedir = "/var"

   logdir = "/var/log/radius"

   libdir = "/usr/lib"

   radacctdir = "/var/log/radius/radacct"

   hostname_lookups = no

   max_request_time = 30

   cleanup_delay = 5

   max_requests = 1024

   allow_core_dumps = no

   pidfile = "/var/run/radiusd/radiusd.pid"

   checkrad = "/usr/sbin/checkrad"

   debug_level = 0

   proxy_requests = yes

   log_auth = yes

   log_auth_badpass = yes

   log_auth_goodpass = yes

   log_stripped_names = no

}

 client 10.2.0.24 {

   require_message_authenticator = no

   secret = "secret"

   shortname = "xxxx"

   nastype = "other"

 }

radiusd: #### Loading Realms and Home Servers ####

 proxy server {

   retry_delay = 5

   retry_count = 3

   default_fallback = yes

   dead_time = 120

   wake_all_if_all_dead = no

 }

 realm LOCAL {

   authhost = LOCAL

   accthost = LOCAL

 }

radiusd: #### Instantiating modules ####

 instantiate {

 Module: Linked to module rlm_exec

 Module: Instantiating exec

  exec {

   wait = yes

   input_pairs = "request"

   shell_escape = yes

  }

 Module: Linked to module rlm_expr

 Module: Instantiating expr

 }

radiusd: #### Loading Virtual Servers ####

server {

 modules {

 Module: Checking authenticate {...} for more modules to load

 Module: Linked to module rlm_pap

 Module: Instantiating pap

  pap {

   encryption_scheme = "auto"

   auto_header = yes

  }

 Module: Linked to module rlm_chap

 Module: Instantiating chap

 Module: Linked to module rlm_mschap

 Module: Instantiating mschap

  mschap {

   use_mppe = yes

   require_encryption = no

   require_strong = no

   with_ntdomain_hack = no

  }

 Module: Checking authorize {...} for more modules to load

 Module: Linked to module rlm_preprocess

 Module: Instantiating preprocess

  preprocess {

   huntgroups = "/etc/raddb/huntgroups"

   hints = "/etc/raddb/hints"

   with_ascend_hack = no

   ascend_channels_per_line = 23

   with_ntdomain_hack = no

   with_specialix_jetstream_hack = no

   with_cisco_vsa_hack = no

   with_alvarion_vsa_hack = no

  }

 Module: Linked to module rlm_detail

 Module: Instantiating auth_log

  detail auth_log {

   detailfile = "/var/log/radius/radacct/%{Client-IP-Address}/auth-detail-%Y%m%d"

   header = "%t"

   detailperm = 384

   dirperm = 493

   locking = no

   log_packet_header = no

  }

 Module: Linked to module rlm_sql

 Module: Instantiating sql

  sql {

   driver = "rlm_sql_mysql"

   server = "localhost"

   port = ""

   login = "radius"

   password = "radpass"

   radius_db = "radius"

   read_groups = yes

   sqltrace = no

   sqltracefile = "/var/log/radius/sqltrace.sql"

   readclients = no

   deletestalesessions = yes

   num_sql_socks = 5

   sql_user_name = "%{User-Name}"

   default_user_profile = ""

   nas_query = "SELECT id,nasname,shortname,type,secret FROM nas"

   authorize_check_query = "SELECT id, UserName, Attribute, Value, op           FROM radcheck           WHERE Username = '%{SQL-User-Name}'           ORDER BY id"

   authorize_reply_query = "SELECT id, UserName, Attribute, Value, op           FROM radreply           WHERE Username = '%{SQL-User-Name}'           ORDER BY id"

   authorize_group_check_query = "SELECT radgroupcheck.id,radgroupcheck.GroupName,radgroupcheck.Attribute,radgroupcheck.Value,radgroupcheck.op  FROM radgroupcheck,usergroup WHERE usergroup.Username = '%{SQL-User-Name}' AND usergroup.GroupName = radgroupcheck.GroupName ORDER BY radgroupcheck.id"

   authorize_group_reply_query = "SELECT radgroupreply.id,radgroupreply.GroupName,radgroupreply.Attribute,radgroupreply.Value,radgroupreply.op  FROM radgroupreply,usergroup WHERE usergroup.Username = '%{SQL-User-Name}' AND usergroup.GroupName = radgroupreply.GroupName ORDER BY radgroupreply.id"

   accounting_onoff_query = "UPDATE radacct SET AcctStopTime='%S', AcctSessionTime=unix_timestamp('%S') - unix_timestamp(AcctStartTime), AcctTerminateCause='%{Acct-Terminate-Cause}', AcctStopDelay = '%{Acct-Delay-Time}' WHERE AcctSessionTime=0 AND AcctStopTime=0 AND NASIPAddress= '%{NAS-IP-Address}' AND AcctStartTime <= '%S'"

   accounting_update_query = "           UPDATE radacct           SET              FramedIPAddress = '%{Framed-IP-Address}',              AcctSessionTime     = '%{Acct-Session-Time}',              AcctInputOctets     = '%{Acct-Input-Gigawords:-0}'  << 32 |                                    '%{Acct-Input-Octets:-0}',              AcctOutputOctets    = '%{Acct-Output-Gigawords:-0}' << 32 |                                    '%{Acct-Output-Octets:-0}'           WHERE AcctSessionId = '%{Acct-Session-Id}'           AND UserName        = '%{SQL-User-Name}'           AND NASIPAddress    = '%{NAS-IP-Address}'"

   accounting_update_query_alt = "           INSERT INTO radacct             (AcctSessionId,    AcctUniqueId,      UserName,              Realm,            NASIPAddress,      NASPortId,              NASPortType,      AcctStartTime,     AcctSessionTime,              AcctAuthentic,    ConnectInfo_start, AcctInputOctets,              AcctOutputOctets, CalledStationId,   CallingStationId,              ServiceType,      FramedProtocol,    FramedIPAddress,              AcctStartDelay,   XAscendSessionSvrKey)           VALUES             ('%{Acct-Session-Id}', '%{Acct-Unique-Session-Id}',              '%{SQL-User-Name}',              '%{Realm}', '%{NAS-IP-Address}', '%{NAS-Port}',              '%{NAS-Port-Type}',              DATE_SUB('%S',                       INTERVAL (%{Acct-Session-Time:-0} +                                 %{Acct-Delay-Time:-0}) SECOND),                       '%{Acct-Session-Time}',              '%{Acct-Authentic}', '',              '%{Acct-Input-Gigawords:-0}' << 32 |              '%{Acct-Input-Octets:-0}',              '%{Acct-Output-Gigawords:-0}' << 32 |              '%{Acct-Output-Octets:-0}',              '%{Called-Station-Id}', '%{Calling-Station-Id}',              '%{Service-Type}', '%{Framed-Protocol}',              '%{Framed-IP-Address}',              '0', '%{X-Ascend-Session-Svr-Key}')"

   accounting_start_query = "           INSERT INTO radacct             (AcctSessionId,    AcctUniqueId,     UserName,              Realm,            NASIPAddress,     NASPortId,              NASPortType,      AcctStartTime,    AcctStopTime,              AcctSessionTime,  AcctAuthentic,    ConnectInfo_start,              ConnectInfo_stop, AcctInputOctets,  AcctOutputOctets,              CalledStationId,  CallingStationId, AcctTerminateCause,              ServiceType,      FramedProtocol,   FramedIPAddress,              AcctStartDelay,   AcctStopDelay,    XAscendSessionSvrKey)           VALUES             ('%{Acct-Session-Id}', '%{Acct-Unique-Session-Id}',              '%{SQL-User-Name}',              '%{Realm}', '%{NAS-IP-Address}', '%{NAS-Port}',              '%{NAS-Port-Type}', '%S', '0',              '0', '%{Acct-Authentic}', '%{Connect-Info}',              '', '0', '0',              '%{Called-Station-Id}', '%{Calling-Station-Id}', '',              '%{Service-Type}', '%{Framed-Protocol}', '%{Framed-IP-Address}',              '%{Acct-Delay-Time:-0}', '0', '%{X-Ascend-Session-Svr-Key}')"

   accounting_start_query_alt = "UPDATE radacct SET AcctStartTime = '%S', AcctStartDelay = '%{Acct-Delay-Time}', ConnectInfo_start = '%{Connect-Info}' WHERE AcctSessionId = '%{Acct-Session-Id}' AND UserName = '%{SQL-User-Name}' AND NASIPAddress = '%{NAS-IP-Address}'"

   accounting_stop_query = "           UPDATE radacct SET              AcctStopTime       = '%S',              AcctSessionTime    = '%{Acct-Session-Time}',              AcctInputOctets    = '%{Acct-Input-Gigawords:-0}' << 32 |                                   '%{Acct-Input-Octets:-0}',              AcctOutputOctets   = '%{Acct-Output-Gigawords:-0}' << 32 |                                   '%{Acct-Output-Octets:-0}',              AcctTerminateCause = '%{Acct-Terminate-Cause}',              AcctStopDelay      = '%{Acct-Delay-Time:-0}',              ConnectInfo_stop   = '%{Connect-Info}'           WHERE AcctSessionId   = '%{Acct-Session-Id}'           AND UserName          = '%{SQL-User-Name}'           AND NASIPAddress      = '%{NAS-IP-Address}'"

   accounting_stop_query_alt = "           INSERT INTO radacct             (AcctSessionId, AcctUniqueId, UserName,              Realm, NASIPAddress, NASPortId,              NASPortType, AcctStartTime, AcctStopTime,              AcctSessionTime, AcctAuthentic, ConnectInfo_start,              ConnectInfo_stop, AcctInputOctets, AcctOutputOctets,              CalledStationId, CallingStationId, AcctTerminateCause,              ServiceType, FramedProtocol, FramedIPAddress,              AcctStartDelay, AcctStopDelay)           VALUES             ('%{Acct-Session-Id}', '%{Acct-Unique-Session-Id}',              '%{SQL-User-Name}',              '%{Realm}', '%{NAS-IP-Address}', '%{NAS-Port}',              '%{NAS-Port-Type}',              DATE_SUB('%S',                  INTERVAL (%{Acct-Session-Time:-0} +                  %{Acct-Delay-Time:-0}) SECOND),              '%S', '%{Acct-Session-Time}', '%{Acct-Authentic}', '',              '%{Connect-Info}',              '%{Acct-Input-Gigawords:-0}' << 32 |              '%{Acct-Input-Octets:-0}',              '%{Acct-Output-Gigawords:-0}' << 32 |              '%{Acct-Output-Octets:-0}',              '%{Called-Station-Id}', '%{Calling-Station-Id}',              '%{Acct-Terminate-Cause}',              '%{Service-Type}', '%{Framed-Protocol}', '%{Framed-IP-Address}',              '0', '%{Acct-Delay-Time:-0}')"

   group_membership_query = "SELECT GroupName FROM usergroup WHERE UserName='%{SQL-User-Name}'"

   connect_failure_retry_delay = 60

   simul_count_query = ""

   simul_verify_query = "SELECT RadAcctId, AcctSessionId, UserName,                                NASIPAddress, NASPortId, FramedIPAddress,                                CallingStationId, FramedProtocol                                FROM radacct                                WHERE UserName='%{SQL-User-Name}'                                AND AcctStopTime = 0"

   postauth_query = "INSERT into radpostauth (user, pass, reply, date) values ('%{User-Name}', '%{User-Password:-Chap-Password}', '%{reply:Packet-Type}', NOW())"

   safe-characters = "@abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789.-_: /"

  }

rlm_sql (sql): Driver rlm_sql_mysql (module rlm_sql_mysql) loaded and linked

rlm_sql (sql): Attempting to connect to radius@localhost:/radius

rlm_sql (sql): starting 0

rlm_sql (sql): Attempting to connect rlm_sql_mysql #0

rlm_sql_mysql: Starting connect to MySQL server for #0

rlm_sql (sql): Connected new DB handle, #0

rlm_sql (sql): starting 1

rlm_sql (sql): Attempting to connect rlm_sql_mysql #1

rlm_sql_mysql: Starting connect to MySQL server for #1

rlm_sql (sql): Connected new DB handle, #1

rlm_sql (sql): starting 2

rlm_sql (sql): Attempting to connect rlm_sql_mysql #2

rlm_sql_mysql: Starting connect to MySQL server for #2

rlm_sql (sql): Connected new DB handle, #2

rlm_sql (sql): starting 3

rlm_sql (sql): Attempting to connect rlm_sql_mysql #3

rlm_sql_mysql: Starting connect to MySQL server for #3

rlm_sql (sql): Connected new DB handle, #3

rlm_sql (sql): starting 4

rlm_sql (sql): Attempting to connect rlm_sql_mysql #4

rlm_sql_mysql: Starting connect to MySQL server for #4

rlm_sql (sql): Connected new DB handle, #4

 Module: Checking preacct {...} for more modules to load

 Module: Linked to module rlm_acct_unique

 Module: Instantiating acct_unique

  acct_unique {

   key = "User-Name, Acct-Session-Id, NAS-IP-Address, Client-IP-Address, NAS-Port"

  }

 Module: Linked to module rlm_realm

 Module: Instantiating suffix

  realm suffix {

   format = "suffix"

   delimiter = "@"

   ignore_default = no

   ignore_null = no

  }

 Module: Linked to module rlm_files

 Module: Instantiating files

  files {

   usersfile = "/etc/raddb/users"

   acctusersfile = "/etc/raddb/acct_users"

   preproxy_usersfile = "/etc/raddb/preproxy_users"

   compat = "no"

  }

 Module: Checking accounting {...} for more modules to load

 Module: Instantiating detail

  detail {

   detailfile = "/var/log/radius/radacct/%{Client-IP-Address}/detail-%Y%m%d"

   header = "%t"

   detailperm = 384

   dirperm = 493

   locking = no

   log_packet_header = no

  }

 Module: Linked to module rlm_unix

 Module: Instantiating unix

  unix {

   radwtmp = "/var/log/radius/radwtmp"

  }

 Module: Linked to module rlm_radutmp

 Module: Instantiating radutmp

  radutmp {

   filename = "/var/log/radius/radutmp"

   username = "%{User-Name}"

   case_sensitive = yes

   check_with_nas = yes

   perm = 384

   callerid = yes

  }

 Module: Checking session {...} for more modules to load

 Module: Checking post-auth {...} for more modules to load

 }

}

radiusd: #### Opening IP addresses and Ports ####

   bind_address = x.x.x.x

WARNING: The directive 'bind_adress' is deprecated, and will be removed in future versions of FreeRADIUS. Please edit the configuration files to use the directive 'listen'.

main {

   snmp = no

   smux_password = ""

   snmp_write_access = no

}

Listening on authentication address x.x.x.x port 1812

Listening on accounting address x.x.x.x port 1813

Listening on proxy address x.x.x.x port 1814

Ready to process requests.

```

and the radiusd.conf file:

```

server raddb # more radiusd.conf | grep -v "#"

prefix = /usr

exec_prefix = ${prefix}

sysconfdir = /etc

localstatedir = /var

sbindir = ${exec_prefix}/sbin

logdir = ${localstatedir}/log/radius

raddbdir = ${sysconfdir}/raddb

radacctdir = ${logdir}/radacct

confdir = ${raddbdir}

run_dir = ${localstatedir}/run/radiusd

log_file = ${logdir}/radius.log

libdir = ${exec_prefix}/lib

pidfile = ${run_dir}/radiusd.pid

user = radiusd

group = radiusd

max_request_time = 30

delete_blocked_requests = no

cleanup_delay = 5

max_requests = 1024

bind_address = x.x.x.x

port = 0

hostname_lookups = no

allow_core_dumps = no

regular_expressions   = yes

extended_expressions   = yes

log_stripped_names = no

log_auth = yes

log_auth_badpass = yes

log_auth_goodpass = yes

usercollide = no

lower_user = no

lower_pass = no

nospace_user = no

nospace_pass = no

checkrad = ${sbindir}/checkrad

security {

   max_attributes = 200

   reject_delay = 1

   status_server = no

}

proxy_requests  = yes

$INCLUDE  ${confdir}/proxy.conf

$INCLUDE  ${confdir}/clients.conf

snmp   = no

$INCLUDE  ${confdir}/snmp.conf

thread pool {

   start_servers = 5

   max_servers = 32

   min_spare_servers = 3

   max_spare_servers = 10

   max_requests_per_server = 0

}

modules {

   pap {

      auto_header = yes

   }

   chap {

      authtype = CHAP

   }

   pam {

      pam_auth = radiusd

   }

   unix {

      cache = no

      cache_reload = 600

      radwtmp = ${logdir}/radwtmp

   }

   mschap {

   }

   realm IPASS {

      format = prefix

      delimiter = "/"

      ignore_default = no

      ignore_null = no

   }

   realm suffix {

      format = suffix

      delimiter = "@"

      ignore_default = no

      ignore_null = no

   }

   realm realmpercent {

      format = suffix

      delimiter = "%"

      ignore_default = no

      ignore_null = no

   }

   realm ntdomain {

      format = prefix

      delimiter = "\\"

      ignore_default = no

      ignore_null = no

   }   

   checkval {

      item-name = Calling-Station-Id

      check-name = Calling-Station-Id

      data-type = string

   }

   

   preprocess {

      huntgroups = ${confdir}/huntgroups

      hints = ${confdir}/hints

      with_ascend_hack = no

      ascend_channels_per_line = 23

      with_ntdomain_hack = no

      with_specialix_jetstream_hack = no

      with_cisco_vsa_hack = no

   }

   files {

      usersfile = ${confdir}/users

      acctusersfile = ${confdir}/acct_users

      preproxy_usersfile = ${confdir}/preproxy_users

      compat = no

   }

   detail {

      detailfile = ${radacctdir}/%{Client-IP-Address}/detail-%Y%m%d

      detailperm = 0600

   }

   detail auth_log {

       detailfile = ${radacctdir}/%{Client-IP-Address}/auth-detail-%Y%m%d

       detailperm = 0600

    }

   acct_unique {

      key = "User-Name, Acct-Session-Id, NAS-IP-Address, Client-IP-Address, NAS-Port"

   }

   $INCLUDE  ${confdir}/sql.conf

   radutmp {

      filename = ${logdir}/radutmp

      username = %{User-Name}

      case_sensitive = yes

      check_with_nas = yes      

      perm = 0600

      callerid = "yes"

   }

   radutmp sradutmp {

      filename = ${logdir}/sradutmp

      perm = 0644

      callerid = "no"

   }

   attr_filter {

      attrsfile = ${confdir}/attrs

   }

   counter daily {

      filename = ${raddbdir}/db.daily

      key = User-Name

      count-attribute = Acct-Session-Time

      reset = daily

      counter-name = Daily-Session-Time

      check-name = Max-Daily-Session

      allowed-servicetype = Framed-User

      cache-size = 5000

   }

   sqlcounter dailycounter {

      counter-name = Daily-Session-Time

      check-name = Max-Daily-Session

      reply-name = Session-Timeout

      sqlmod-inst = sql

      key = User-Name

      reset = daily

      query = "SELECT SUM(AcctSessionTime - \

                 GREATEST((%b - UNIX_TIMESTAMP(AcctStartTime)), 0)) \

                 FROM radacct WHERE UserName='%{%k}' AND \

                 UNIX_TIMESTAMP(AcctStartTime) + AcctSessionTime > '%b'"

   }

   sqlcounter monthlycounter {

      counter-name = Monthly-Session-Time

      check-name = Max-Monthly-Session

      reply-name = Session-Timeout

      sqlmod-inst = sql

      key = User-Name

      reset = monthly

      query = "SELECT SUM(AcctSessionTime - \

                 GREATEST((%b - UNIX_TIMESTAMP(AcctStartTime)), 0)) \

                 FROM radacct WHERE UserName='%{%k}' AND \

                 UNIX_TIMESTAMP(AcctStartTime) + AcctSessionTime > '%b'"

   }

   always fail {

      rcode = fail

   }

   always reject {

      rcode = reject

   }

   always ok {

      rcode = ok

      simulcount = 0

      mpp = no

   }

   expr {

   }

   digest {

   }

   exec {

      wait = yes

      input_pairs = request

   }

   exec echo {

      wait = yes

      program = "/bin/echo %{User-Name}"

      input_pairs = request

      output_pairs = reply

   }

}

instantiate {

   exec

   expr

}

authorize {

   preprocess

   auth_log

   chap

   mschap

   sql

   pap

}

authenticate {

   Auth-Type PAP {

      pap

   }

   Auth-Type CHAP {

      chap

   }

   Auth-Type MS-CHAP {

      mschap

   }

}

preacct {

   preprocess

   acct_unique

   suffix

   files

}

accounting {

   detail

   unix

   radutmp

   sql

}

session {

   radutmp

}

post-auth {

   sql

}

pre-proxy {

}

post-proxy {

}

server raddb # 

```

any ideas?

----------

## Exil

chcek permissions on /var/log/radius. Change them to radiusd:radiusd

----------

## myha

Hi,

thanks for reply.

```

server log # ls -l /var/log/radius*

total 0

-rw-r--r-- 1 radiusd radiusd 0 Aug 27 08:24 radius.log

server log #

server log # ll                 

total 4

drwxr-xr-x 3 radiusd radiusd  104 Aug 27 10:02 radius

-rw------- 1 root    root    1340 Aug 27 10:03 vsftpd.log

server log #  

```

I dont know if it means anything but I have forwarded all my logs to mysql (syslog-ng). I have put it back locally and restarted the service but it didnt help.

----------

## myha

I downgraded back to 1.1.7 and it works fine now again. But I am still open for suggestions.  :Smile: 

----------

## HexDEF6

 *myha wrote:*   

> Hi,
> 
> I just updated the freeradius to latest version and I cannot start it anmore via init script...
> 
> Here is what I get:
> ...

 

same problem here  :Sad: 

EDIT: you need:

```

log_destination = files

```

in your radiusd.conf

----------

## myha

Hi, yes, this solved the issue, thanks!

----------

