Change run_dir default from /var/run to /var/run/radiusd.
authorfcusack <fcusack>
Sun, 26 May 2002 11:24:21 +0000 (11:24 +0000)
committerfcusack <fcusack>
Sun, 26 May 2002 11:24:21 +0000 (11:24 +0000)
/var/run is writable only by root and it is desirable to have
radiusd run as a non-root user (barring any need to read system
files like /etc/shadow).  Changing the default run_dir path
promotes best practices.

Make.inc.in
debian/rules
raddb/radiusd.conf.in
redhat/freeradius.spec
scripts/radwatch.in
scripts/rc.radiusd.in

index d2e2ebd..cb1a1f0 100644 (file)
@@ -40,7 +40,7 @@ LIBS          = @LIBS@
 
 LOGDIR         = ${logdir}
 RADDBDIR       = ${raddbdir}
-RUNDIR         = ${localstatedir}/run
+RUNDIR         = ${localstatedir}/run/radiusd
 SBINDIR                = ${sbindir}
 RADIR          = ${radacctdir}
 
index 8528334..a55b2ee 100755 (executable)
@@ -59,7 +59,6 @@ binary-arch: build
                | sed -e 's/        /   /g' \
                | sed -e '/^    example {/,/^   }/s/^/#/' \
                | sed -e 's/^           #       shadow          =/              shadow          =/' \
-               | sed -e 's#^\(run_dir = .{localstatedir}/run\)#\1/radiusd#' \
                | sed -e 's/^group = nobody/group = freerad/' \
                | sed -e 's/^user = nobody/user = freerad/' \
                        > $(radiusd_freeradius_dir)/$(raddbdir)/radiusd.conf; \
index bed0893..a167514 100644 (file)
@@ -31,7 +31,7 @@ radacctdir = @radacctdir@
 
 #  Location of config and logfiles.
 confdir = ${raddbdir}
-run_dir = ${localstatedir}/run
+run_dir = ${localstatedir}/run/radiusd
 
 #
 # libdir: Where to find the rlm_* modules.
@@ -74,7 +74,7 @@ libdir = @libdir@
 #
 #  This file is written when ONLY running in daemon mode.
 #
-#  e.g.:  kill -HUP `cat /var/run/radiusd.pid`
+#  e.g.:  kill -HUP `cat /var/run/radiusd/radiusd.pid`
 #
 pidfile = ${run_dir}/radiusd.pid
 
index d7cbc40..794e1a6 100644 (file)
@@ -65,12 +65,6 @@ if [ "$1" = "0" ]; then
        /sbin/chkconfig --add radiusd
 fi
 
-mkdir -p /var/log/radius/radacct
-chmod 700 /var/log/radius
-chmod 700 /var/log/radius/radacct
-chown root:root /var/log/radius
-chown root:root /var/log/radius/radacct
-
 # Done here to avoid messing up existing installations
 for i in radius/radutmp radius/radwtmp # radius/radius.log radius/radwatch.log radius/checkrad.log
 do
@@ -93,14 +87,14 @@ rm -rf $RPM_BUILD_ROOT
 /usr/bin/*
 /usr/sbin/*
 /usr/lib/*
-#%dir(missingok) /var/log/radius/radacct/
-#/var/log/radius/checkrad.log
-#/var/log/radius/radwatch.log
-#/var/log/radius/radius.log
-#/var/log/radius/radwtmp
-#/var/log/radius/radutmp
+%attr(0700,root,root) %dir /var/log/radius
+%attr(0700,root,root) %dir /var/log/radius/radacct
+%attr(0700,root,root) %dir /var/run/radiusd
 
 %changelog
+* Sun May 26 2002 Frank Cusack <frank@google.com>
+- move /var dirs from %%post to %%files
+
 * Thu Feb 14 2002 Marko Myllynen
 - use dir name macros in all configure options
 - libtool is required only when building the package
@@ -112,7 +106,7 @@ rm -rf $RPM_BUILD_ROOT
 - clean up name/version
 
 * Fri Jan 18 2002 Frank Cusack <frank@google.com>
-- remove (noreplace) for /etc/raddb/*
+- remove (noreplace) for /etc/raddb/* (due to rpm bugs)
 
 * Fri Sep 07 2001 Ivan F. Martinez <ivanfm@ecodigit.com.br>
 - changes to make compatible with default config file shipped
index 4c8473d..fafc462 100755 (executable)
@@ -20,7 +20,7 @@ exec_prefix=@exec_prefix@
 sbindir=@sbindir@
 localstatedir=@localstatedir@
 logdir=@logdir@
-rundir=${localstatedir}/run
+rundir=${localstatedir}/run/radius
 
 MAILTO=root
 RADIUSD=$sbindir/radiusd
index e3cfc4d..d35ef72 100755 (executable)
@@ -23,7 +23,7 @@ exec_prefix=@exec_prefix@
 sbindir=@sbindir@
 localstatedir=@localstatedir@
 logdir=@logdir@
-rundir=${localstatedir}/run
+rundir=${localstatedir}/run/radiusd
 
 RADIUSD=$sbindir/radiusd
 WATCHER=$sbindir/radwatch