make our own versions of init scripts, pam.conf, logrotate so we can edit

them rather than copying from src tarball and patching
This commit is contained in:
John Dennis 2008-02-29 04:16:24 +00:00
parent 1312e014f2
commit eb87cfeab1
5 changed files with 233 additions and 5 deletions

56
freeradius-logrotate Normal file
View File

@ -0,0 +1,56 @@
# You can use this to rotate the /var/log/radius/* files, simply copy
# it to /etc/logrotate.d/radiusd
# There are different detail-rotating strategies you can use. One is
# to write to a single detail file per IP and use the rotate config
# below. Another is to write to a daily detail file per IP with:
# detailfile = ${radacctdir}/%{Client-IP-Address}/%Y%m%d-detail
# (or similar) in radiusd.conf, without rotation. If you go with the
# second technique, you will need another cron job that removes old
# detail files. You do not need to comment out the below for method #2.
/var/log/radius/radacct/*/detail {
monthly
rotate 4
nocreate
missingok
compress
}
/var/log/radius/checkrad.log {
monthly
rotate 4
create
missingok
compress
}
/var/log/radius/radius.log {
monthly
rotate 4
create
missingok
compress
}
/var/log/radius/radutmp {
monthly
rotate 4
create
compress
missingok
}
/var/log/radius/radwtmp {
monthly
rotate 4
create
compress
missingok
}
/var/log/radius/sqltrace.sql {
monthly
rotate 4
create
compress
missingok
}

6
freeradius-pam-conf Normal file
View File

@ -0,0 +1,6 @@
#%PAM-1.0
auth include system-auth
account required pam_nologin.so
account include system-auth
password include system-auth
session include system-auth

80
freeradius-radiusd.init Executable file
View File

@ -0,0 +1,80 @@
#!/bin/sh
#
# chkconfig: - 88 10
# description: Start/Stop the RADIUS server daemon
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
#
# Copyright (C) 2001 The FreeRADIUS Project http://www.freeradius.org
#
# Source function library.
. /etc/rc.d/init.d/functions
RADIUSD=/usr/sbin/radiusd
LOCKF=/var/lock/subsys/radiusd
CONFIG=/etc/raddb/radiusd.conf
[ -f $RADIUSD ] || exit 0
[ -f $CONFIG ] || exit 0
RETVAL=0
case "$1" in
start)
echo -n $"Starting RADIUS server: "
daemon $RADIUSD
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && touch $LOCKF &&
ln -s /var/run/radiusd/radiusd.pid /var/run/radiusd.pid 2>/dev/null
;;
stop)
echo -n $"Stopping RADIUS server: "
killproc $RADIUSD
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && rm -f $LOCKF
;;
status)
status radiusd
RETVAL=$?
;;
reload)
echo -n $"Reloading RADIUS server: "
killproc $RADIUSD -HUP
RETVAL=$?
echo
;;
restart)
$0 stop
sleep 3
$0 start
RETVAL=$?
;;
condrestart)
if [ -f $LOCKF ]; then
$0 stop
sleep 3
$0 start
RETVAL=$?
fi
;;
*)
echo $"Usage: $0 {start|stop|status|restart|reload|condrestart}"
exit 1
esac
exit $RETVAL

80
freeradius-radrelay.init Executable file
View File

@ -0,0 +1,80 @@
#!/bin/sh
#
# chkconfig: - 88 10
# description: Start/Stop the RADIUS server daemon
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
#
# Copyright (C) 2001 The FreeRADIUS Project http://www.freeradius.org
#
# Source function library.
. /etc/rc.d/init.d/functions
RADIUSD=/usr/sbin/radiusd
LOCKF=/var/lock/subsys/radiusd
CONFIG=/etc/raddb/radiusd.conf
[ -f $RADIUSD ] || exit 0
[ -f $CONFIG ] || exit 0
RETVAL=0
case "$1" in
start)
echo -n $"Starting RADIUS server: "
daemon $RADIUSD
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && touch $LOCKF &&
ln -s /var/run/radiusd/radiusd.pid /var/run/radiusd.pid 2>/dev/null
;;
stop)
echo -n $"Stopping RADIUS server: "
killproc $RADIUSD
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && rm -f $LOCKF
;;
status)
status radiusd
RETVAL=$?
;;
reload)
echo -n $"Reloading RADIUS server: "
killproc $RADIUSD -HUP
RETVAL=$?
echo
;;
restart)
$0 stop
sleep 3
$0 start
RETVAL=$?
;;
condrestart)
if [ -f $LOCKF ]; then
$0 stop
sleep 3
$0 start
RETVAL=$?
fi
;;
*)
echo $"Usage: $0 {start|stop|status|restart|reload|condrestart}"
exit 1
esac
exit $RETVAL

View File

@ -1,8 +1,7 @@
# FIXME: should pki certs be moved to /etc/pki?
# FIXME: are the group names right?
# FIXME: need to run rpmlint
# FIXME: need radrelay init.d script
# FIXME: check each of the files loaded from the redhat directory
# FIXME: edit radrelay init.d script, was copied from radiusd init
# FIXME: check each former patch, do we still need any?
Summary: High-performance and highly configurable free RADIUS server
Name: freeradius
@ -13,6 +12,10 @@ Group: System Environment/Daemons
URL: http://www.freeradius.org/
Source0: ftp://ftp.freeradius.org/pub/radius/%{name}-server-%{version}.tar.bz2
Source100: freeradius-radiusd.init
Source101: freeradius-radrelay.init
Source102: freeradius-logrotate
Source103: freeradius-pam-conf
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
@ -236,9 +239,11 @@ perl -i -pe 's/^#group =.*$/group = radiusd/' $RADDB/radrelay.conf
mkdir -p $RPM_BUILD_ROOT/var/log/radius/radacct
touch $RPM_BUILD_ROOT/var/log/radius/{radutmp,radius.log}
install -m 644 redhat/radiusd-pam $RPM_BUILD_ROOT/%{_sysconfdir}/pam.d/radiusd
install -m 644 redhat/radiusd-logrotate $RPM_BUILD_ROOT/%{_sysconfdir}/logrotate.d/radiusd
install -m 755 redhat/rc.radiusd-redhat $RPM_BUILD_ROOT/%{_initrddir}/radiusd
install -m 755 %{SOURCE100} $RPM_BUILD_ROOT/%{_initrddir}/radiusd
install -m 755 %{SOURCE101} $RPM_BUILD_ROOT/%{_initrddir}/radrelay
install -m 644 %{SOURCE102} $RPM_BUILD_ROOT/%{_sysconfdir}/logrotate.d/radiusd
install -m 644 %{SOURCE103} $RPM_BUILD_ROOT/%{_sysconfdir}/pam.d/radiusd
(cd $RPM_BUILD_ROOT/usr/sbin && ln -sf ./radiusd radrelay)
# install dialup_admin
DIALUPADMIN=$RPM_BUILD_ROOT%{_datadir}/dialup_admin
@ -297,6 +302,7 @@ fi
%config(noreplace) %{_sysconfdir}/pam.d/radiusd
%config(noreplace) %{_sysconfdir}/logrotate.d/radiusd
%config(noreplace) %{_initrddir}/radiusd
%config(noreplace) %{_initrddir}/radrelay
%dir %attr(755,radiusd,radiusd) /var/lib/radiusd
# configs
%dir %attr(750,-,radiusd) /etc/raddb