diff -Nur e-smith-radiusd-2.6.0.old/createlinks e-smith-radiusd-2.6.0/createlinks --- e-smith-radiusd-2.6.0.old/createlinks 2020-12-08 16:06:11.084000000 -0500 +++ e-smith-radiusd-2.6.0/createlinks 2020-12-08 21:29:26.020000000 -0500 @@ -17,11 +17,15 @@ user-lock user-modify user-modify-admin + e-smith-radiusd-update )); } templates2events("/etc/raddb/radiusd.conf", "bootstrap-ldap-save"); templates2events("/etc/radiusclient-ng/radiusclient.conf", "bootstrap-console-save"); +templates2events("/etc/raddb/radiusd.conf", "e-smith-radiusd-update"); +templates2events("/etc/radiusclient-ng/radiusclient.conf", "e-smith-radiusd-update"); + foreach (qw( raddb/clients.conf raddb/mods-available/eap @@ -38,6 +42,7 @@ domain-modify remoteaccess-update ldap-update + e-smith-radiusd-update )); } @@ -51,7 +56,8 @@ domain-modify remoteaccess-update ldap-update - )); + e-smith-radiusd-update + )); } foreach $event ( qw( @@ -70,8 +76,11 @@ safe_symlink("sigterm", "root/etc/e-smith/events/$event/services2adjust/radiusd"); } -safe_symlink("../daemontools", "root/etc/rc.d/init.d/supervise/radiusd"); -service_link_enhanced("radiusd", "S90", "7"); +$event="e-smith-radiusd-update"; +safe_symlink("restart", "root/etc/e-smith/events/$event/services2adjust/radiusd"); +# systemd-specific action mandatory for this package-update event +event_link("systemd-reload", $event, "89"); +event_link("systemd-default", $event, "88"); # activate modules #safe_symlink("../mods-available/realm", "root/etc/raddb/mods-enabled/realm"); diff -Nur e-smith-radiusd-2.6.0.old/root/sbin/e-smith/systemd/radiusd-certificate e-smith-radiusd-2.6.0/root/sbin/e-smith/systemd/radiusd-certificate --- e-smith-radiusd-2.6.0.old/root/sbin/e-smith/systemd/radiusd-certificate 1969-12-31 19:00:00.000000000 -0500 +++ e-smith-radiusd-2.6.0/root/sbin/e-smith/systemd/radiusd-certificate 2020-12-08 16:10:24.090000000 -0500 @@ -0,0 +1,40 @@ +#!/usr/bin/perl -w + +#---------------------------------------------------------------------- +# copyright (C) 2005 Mitel Networks Corporation +# +# 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# Technical support for this program is available from Mitel Networks +# Please visit our web site www.mitel.com/sme/ for details. +#---------------------------------------------------------------------- + +use esmith::tcpsvd; +use esmith::ConfigDB; +use File::Copy; + +my $c = esmith::ConfigDB->open_ro; +my $s = $c->get('SystemName')->value; +my $d = $c->get('DomainName')->value; + +my $pem = "/etc/raddb/certs/radiusd.pem"; +# Now copy system pem file into jail used by stunnel/sslio +copy("/home/e-smith/ssl.pem/$s.$d.pem", "$pem.$$") + or die "failed to copy SSL PEM: $!"; +chmod 0640, "$pem.$$"; +esmith::util::chownFile("root", "radiusd", "$pem.$$"); +rename("$pem.$$", "$pem") + or die "failed to rename $pem.$$ to $pem: $!"; + diff -Nur e-smith-radiusd-2.6.0.old/root/sbin/e-smith/systemd/radiusd-configure e-smith-radiusd-2.6.0/root/sbin/e-smith/systemd/radiusd-configure --- e-smith-radiusd-2.6.0.old/root/sbin/e-smith/systemd/radiusd-configure 1969-12-31 19:00:00.000000000 -0500 +++ e-smith-radiusd-2.6.0/root/sbin/e-smith/systemd/radiusd-configure 2020-12-08 16:09:55.326000000 -0500 @@ -0,0 +1,10 @@ +#!/bin/sh + +# Ensure that PRNG is adequately seeded. +[ -s /etc/raddb/certs/dh ] ||\ + /usr/local/bin/envuidgid stunnel \ + /usr/bin/openssl gendh > /etc/raddb/certs/dh +[ -s /etc/raddb/certs/random ] ||\ + /usr/local/bin/envuidgid stunnel \ + /bin/dd if=/dev/urandom of=/etc/raddb/certs/random bs=1k count=1 + diff -Nur e-smith-radiusd-2.6.0.old/root/usr/lib/systemd/system/radiusd.service.d/50-koozali.conf e-smith-radiusd-2.6.0/root/usr/lib/systemd/system/radiusd.service.d/50-koozali.conf --- e-smith-radiusd-2.6.0.old/root/usr/lib/systemd/system/radiusd.service.d/50-koozali.conf 1969-12-31 19:00:00.000000000 -0500 +++ e-smith-radiusd-2.6.0/root/usr/lib/systemd/system/radiusd.service.d/50-koozali.conf 2020-12-08 21:09:28.379000000 -0500 @@ -0,0 +1,12 @@ +[Service] +ExecStartPre= +ExecStartPre=/sbin/e-smith/service-status radiusd +ExecStartPre=/sbin/e-smith/systemd/radiusd-configure +ExecStartPre=/sbin/e-smith/systemd/radiusd-certificate +ExecStartPre=-/bin/chown -R radiusd.radiusd /var/run/radiusd +ExecStartPre=/usr/sbin/radiusd -C +Restart=always + +[Install] +WantedBy=sme-server.target +