[csw-devel] SF.net SVN: gar:[11828] csw/mgar/pkg/freeradius/trunk

gadavis at users.sourceforge.net gadavis at users.sourceforge.net
Tue Dec 7 22:32:35 CET 2010


Revision: 11828
          http://gar.svn.sourceforge.net/gar/?rev=11828&view=rev
Author:   gadavis
Date:     2010-12-07 21:32:35 +0000 (Tue, 07 Dec 2010)

Log Message:
-----------
add init script

Modified Paths:
--------------
    csw/mgar/pkg/freeradius/trunk/Makefile

Added Paths:
-----------
    csw/mgar/pkg/freeradius/trunk/files/cswfreeradius

Modified: csw/mgar/pkg/freeradius/trunk/Makefile
===================================================================
--- csw/mgar/pkg/freeradius/trunk/Makefile	2010-12-07 21:30:34 UTC (rev 11827)
+++ csw/mgar/pkg/freeradius/trunk/Makefile	2010-12-07 21:32:35 UTC (rev 11828)
@@ -9,6 +9,7 @@
 
 MASTER_SITES = ftp://ftp.freeradius.org:/pub/freeradius/
 DISTFILES  = $(GARNAME)-server-$(GARVERSION).tar.gz
+DISTFILES += cswfreeradius
 DISTNAME = $(GARNAME)-server-$(GARVERSION)
 
 UFILES_REGEX = $(GARNAME)-(\d+(?:\.\d+)*).tar.gz
@@ -141,6 +142,16 @@
 
 INSTALL_ARGS += R=$(DESTDIR)
 
+INITSMF = /etc/opt/csw/init.d/cswapache2
+
 include gar/category.mk
 
 PATH := /opt/csw/gnu:$(PATH)
+
+post-install-modulated: copy-local-files
+
+# Copy in specialized templates
+copy-local-files:
+	@ginstall -d $(DESTDIR)/etc/opt/csw/init.d
+	@ginstall $(WORKDIR)/cswfreeradius $(DESTDIR)/etc/opt/csw/init.d
+	@$(MAKECOOKIE)

Added: csw/mgar/pkg/freeradius/trunk/files/cswfreeradius
===================================================================
--- csw/mgar/pkg/freeradius/trunk/files/cswfreeradius	                        (rev 0)
+++ csw/mgar/pkg/freeradius/trunk/files/cswfreeradius	2010-12-07 21:32:35 UTC (rev 11828)
@@ -0,0 +1,100 @@
+#!/bin/sh
+#
+# radiusd	Start the radius 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-2008 The FreeRADIUS Project http://www.freeradius.org
+
+prefix=/opt/csw
+exec_prefix=/opt/csw
+sbindir=/opt/csw/sbin
+localstatedir=/var/opt/csw
+logdir=${localstatedir}/log/radius
+rundir=${localstatedir}/run/radiusd
+sysconfdir=/etc/opt/csw
+
+#
+#  If you have issues with OpenSSL, uncomment these next lines.
+#
+#  Something similar may work for MySQL, and you may also
+#  have to LD_PRELOAD libz.so
+#
+#LD_LIBRARY_PATH= -lcrypto -lssl -lcrypto
+#LD_RUN_PATH= -lcrypto -lssl -lcrypto:
+#LD_PRELOAD= -lcrypto -lssl -lcryptolibcrypto.so
+export LD_LIBRARY_PATH LD_RUN_PATH LD_PRELOAD
+
+RADIUSD=$sbindir/radiusd
+RADDBDIR=/etc/opt/csw/raddb
+DESC="FreeRADIUS"
+
+#
+#  See 'man radiusd' for details on command-line options.
+#
+ARGS=""
+
+test -f $RADIUSD || exit 0
+test -f $RADDBDIR/radiusd.conf || exit 0
+
+#if [ ! -d $rundir ] ; then
+#    mkdir $rundir
+#    chown radmin:radius $rundir
+#    chmod 775 $rundir
+#fi
+#
+#if [ ! -d $logdir ] ; then
+#    mkdir $logdir
+#    chown radmin:radius $logdir
+#    chmod 770 $logdir
+#    chmod g+s $logdir
+#fi
+#
+#if [ ! -f $logdir/radius.log ]; then
+#        touch $logdir/radius.log
+#fi
+#
+#chown radmin:radius $logdir/radius.log
+#chmod 660 $logdir/radius.log
+
+case "$1" in
+  start)
+	echo -n "Starting $DESC:"
+	$RADIUSD $ARGS
+	echo "radiusd"
+	;;
+  stop)
+	[ -z "$2" ] && echo -n "Stopping $DESC: "
+        [ -f $rundir/radiusd.pid ] && kill -TERM `cat $rundir/radiusd.pid`
+	[ -z "$2" ] && echo "radiusd."
+	;;
+  reload|force-reload)
+	echo "Reloading $DESC configuration files."
+	[ -f $rundir/radiusd.pid ] && kill -HUP `cat $rundir/radiusd.pid`
+	;;
+  restart)
+	sh $0 stop quiet
+	sleep 3
+	sh $0 start
+	;;
+  check)
+  	$RADIUSD -C $ARGS
+	;;
+  *)
+        echo "Usage: /etc/init.d/$RADIUS {start|stop|reload|restart|check}"
+        exit 1
+esac
+
+exit 0


Property changes on: csw/mgar/pkg/freeradius/trunk/files/cswfreeradius
___________________________________________________________________
Added: svn:executable
   + *


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.


More information about the devel mailing list