net-dialup/freeradius: Run service as radius user by default.
authorMatt Turner <mattst88@gentoo.org>
Wed, 23 Nov 2016 18:19:55 +0000 (10:19 -0800)
committerMatt Turner <mattst88@gentoo.org>
Sat, 26 Nov 2016 22:27:17 +0000 (14:27 -0800)
Bug: https://bugs.gentoo.org/465768

net-dialup/freeradius/files/radius.conf-r4 [new file with mode: 0644]
net-dialup/freeradius/freeradius-3.0.12-r1.ebuild

diff --git a/net-dialup/freeradius/files/radius.conf-r4 b/net-dialup/freeradius/files/radius.conf-r4
new file mode 100644 (file)
index 0000000..a5760d2
--- /dev/null
@@ -0,0 +1,16 @@
+# Config file for /etc/init.d/radiusd
+
+# see man pages for radiusd run `radiusd -h`
+# for valid cmdline options
+#RADIUSD_OPTS=""
+
+# Change this value if you change it in /etc/raddb/radiusd.conf
+pidfile=/var/run/radiusd/radiusd.pid
+
+# Change these values if you change them in /etc/raddb/radiusd.conf
+RADIUSD_USER=radius
+RADIUSD_GROUP=radius
+
+# If you set up logging to syslog in /etc/raddb/radiusd.conf, you want
+# to uncomment the following line.
+#rc_use="logger"
index 48c72ca85f42eba230edc5e4d450f922e4de8c69..f69459b72293b49ec169ddf8a879a47c1ccf19a6 100644 (file)
@@ -98,6 +98,8 @@ src_prepare() {
        }
 
        sed -i \
+               -e 's:^#\tuser = :\tuser = :g' \
+               -e 's:^#\tgroup = :\tgroup = :g' \
                -e 's:/var/run/radiusd:/run/radiusd:g' \
                -e '/^run_dir/s:${localstatedir}::g' \
                raddb/radiusd.conf.in || die
@@ -196,7 +198,7 @@ src_install() {
        rm "${D}/usr/sbin/rc.radiusd" || die
 
        newinitd "${FILESDIR}/radius.init-r3" radiusd
-       newconfd "${FILESDIR}/radius.conf-r3" radiusd
+       newconfd "${FILESDIR}/radius.conf-r4" radiusd
 
        prune_libtool_files
 }
@@ -205,6 +207,8 @@ pkg_config() {
        if use ssl; then
                cd "${ROOT}"/etc/raddb/certs
                ./bootstrap
+
+               chown -R root:radius "${ROOT}"/etc/raddb/certs
        fi
 }