LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 04-23-2015, 02:47 AM   #1
circus78
Member
 
Registered: Dec 2011
Posts: 273

Rep: Reputation: Disabled
Radiusd init script not working


Hi,
I noticed that init script for radiusd service is not working:

Code:
# ps aux |grep rad
radiusd  21663  0.3  2.3 2403784 11996 ?       Ssl  Apr17  30:24 /usr/sbin/radiusd -d /etc/raddb
root     27183  0.0  0.1 103244   864 pts/0    S+   09:45   0:00 grep rad
# service radiusd stop
# ps aux |grep rad
radiusd  21663  0.3  2.3 2403784 11996 ?       Ssl  Apr17  30:24 /usr/sbin/radiusd -d /etc/raddb
root     27194  0.0  0.1 103244   868 pts/0    S+   09:45   0:00 grep rad
#
I am using CentOS 6.6, official radiusd package:

Code:
# cat /etc/redhat-release
CentOS release 6.6 (Final)
# yum list installed |grep radiu
freeradius.x86_64                  2.1.12-6.el6                       @base
freeradius-mysql.x86_64            2.1.12-6.el6                       @base
freeradius-utils.x86_64            2.1.12-6.el6                       @base
init script:

Code:
# cat /etc/init.d/radiusd
#!/bin/sh
#
# radiusd Start/Stop the FreeRADIUS daemon
#
# chkconfig: - 88 10
# description: Extensible, configurable, high performance RADIUS server.

### BEGIN INIT INFO
# Provides: radiusd
# Required-Start: $network
# Required-Stop:
# Default-Start:
# Default-Stop:
# Should-Start: $time $syslog mysql ldap postgresql samba krb5-kdc
# Should-Stop:
# Short-Description: FreeRADIUS server
# Description: Extensible, configurable, high performance RADIUS server.
### END INIT INFO

# Source function library.
. /etc/rc.d/init.d/functions

prog=radiusd

[ -e /etc/sysconfig/$prog ] && . /etc/sysconfig/$prog

exec=${exec:=/usr/sbin/$prog}
config_dir=${config_dir:=/etc/raddb}
config=${config:=$config_dir/radiusd.conf}
pidfile=${pidfile:=/var/run/$prog/$prog.pid}
lockfile=${lockfile:=/var/lock/subsys/radiusd}

start() {
    [ -x $exec ] || exit 5
    [ -f $config ] || exit 6
    echo -n $"Starting $prog: "
    daemon --pidfile $pidfile $exec -d $config_dir
    retval=$?
    echo
    [ $retval -eq 0 ] && touch $lockfile
    return $retval
}

stop() {
    echo -n $"Stopping $prog: "
    killproc -p $pidfile $prog
    retval=$?
    echo
    [ $retval -eq 0 ] && rm -f $lockfile
    return $retval
}

restart() {
    stop
    start
}

reload() {
    # radiusd may not be capable of a 100% configuration reload depending
    # on which loadable modules are in use, if sending the server a
    # HUP is not sufficient then use restart here instead. However, we
    # prefer by default to use HUP since it's what is usually desired.
    #
    # restart

    kill -HUP `pidofproc -p $pidfile $prog`
}

force_reload() {
    restart
}

rh_status() {
    # run checks to determine if the service is running or use generic status
    status -p $pidfile $prog
}

rh_status_q() {
    rh_status >/dev/null 2>&1
}


case "$1" in
    start)
        rh_status_q && exit 0
        $1
        ;;
    stop)
        rh_status_q || exit 0
        $1
        ;;
    restart)
        $1
        ;;
    reload)
        rh_status_q || exit 7
        $1
        ;;
    force-reload)
        force_reload
        ;;
    status)
        rh_status
        ;;
    condrestart|try-restart)
        rh_status_q || exit 0
        restart
        ;;
    *)
        echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload}"
        exit 2
esac
exit $?
Thank you
 
Old 04-23-2015, 02:54 AM   #2
circus78
Member
 
Registered: Dec 2011
Posts: 273

Original Poster
Rep: Reputation: Disabled
Sorry, solved by myself.

There is a wrong reference in init script:

Quote:
prog=radiusd
pidfile=${pidfile:=/var/run/$prog/$prog.pid}
Actually pid file is freeradius.pid, not radiusd.pid
I can fix this in radiusd.conf
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] script in /etc/init.d not working Annielover Programming 12 06-13-2011 12:22 PM
init.d script not working waffe Ubuntu 1 12-03-2007 02:55 PM
homemade init script not working scylla Linux - General 2 01-21-2005 07:26 PM
Init Script for p4d not working UglyWrangler Linux - Newbie 2 01-18-2005 10:45 AM
can't get my init script working nukeu666 Linux - Newbie 4 12-16-2004 11:12 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 10:42 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration