7 Commits

18 changed files with 83 additions and 70 deletions

1
.gitignore vendored
View File

@@ -2,3 +2,4 @@
*.log
*spec-20*
*.tar.xz
*.bak

View File

@@ -6,7 +6,14 @@ SMEServer Koozali developed git repo for smeserver-tinydns smeserver
<br />https://wiki.koozali.org/
## Bugzilla
Show list of outstanding bugs: [here](https://bugs.koozali.org/buglist.cgi?component=smeserver-tinydns&product=SME%20Server%2010.X&query_format=advanced&limit=0&bug_status=UNCONFIRMED&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&bug_status=CONFIRMED)\
Show list of outstanding bugs:
[All](https://bugs.koozali.org/buglist.cgi?action=wrap&bug_status=UNCONFIRMED&bug_status=CONFIRMED&bug_status=NEEDINFO&bug_status=IN_PROGRESS&bug_status=RESOLVED&bug_status=VERIFIED&cf_package=smeserver-tinydns&classification=SME+Server&list_id=105756&order=changeddate+DESC%2Ccomponent%2Cpriority%2Cbug_severity&query_format=advanced)
[Confirmed](https://bugs.koozali.org/buglist.cgi?action=wrap&bug_status=CONFIRMED&cf_package=smeserver-tinydns&classification=SME+Server&order=changeddate+DESC%2Ccomponent%2Cpriority%2Cbug_severity&query_format=advanced)
[Unconfirmed](https://bugs.koozali.org/buglist.cgi?action=wrap&bug_status=UNCONFIRMED&cf_package=smeserver-tinydns&classification=SME+Server&order=changeddate+DESC%2Ccomponent%2Cpriority%2Cbug_severity&query_format=advanced)
[Need info](https://bugs.koozali.org/buglist.cgi?action=wrap&bug_status=NEEDINFO&cf_package=smeserver-tinydns&classification=SME+Server&order=changeddate+DESC%2Ccomponent%2Cpriority%2Cbug_severity&query_format=advanced)
[In progress](https://bugs.koozali.org/buglist.cgi?action=wrap&bug_status=IN_PROGRESS&cf_package=smeserver-tinydns&classification=SME+Server&order=changeddate+DESC%2Ccomponent%2Cpriority%2Cbug_severity&query_format=advanced)
[Resolved](https://bugs.koozali.org/buglist.cgi?action=wrap&bug_status=RESOLVED&cf_package=smeserver-tinydns&classification=SME+Server&order=changeddate+DESC%2Ccomponent%2Cpriority%2Cbug_severity&query_format=advanced)
[Verified](https://bugs.koozali.org/buglist.cgi?action=wrap&bug_status=VERIFIED&cf_package=smeserver-tinydns&classification=SME+Server&order=changeddate+DESC%2Ccomponent%2Cpriority%2Cbug_severity&query_format=advanced)
And a list of outstanding Legacy bugs: (e-smith-tinydns) [here](https://bugs.koozali.org/buglist.cgi?component=e-smith-tinydns&product=SME%20Server%2010.X&query_format=advanced&limit=0&bug_status=UNCONFIRMED&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&bug_status=CONFIRMED)
## Description

View File

@@ -1 +0,0 @@
sme10

View File

@@ -7,23 +7,21 @@ use esmith::Build::CreateLinks qw(:all);
#-------------------------------------------------------------------
# actions for bootstrap-console-save event, smeserver-tinydns-update :
#-------------------------------------------------------------------
foreach (qw(
env/IP
env/DATALIMIT
root/data
))
{
templates2events("/var/service/tinydns/$_", qw(
templates2events("/var/service/tinydns/root/data", qw(
bootstrap-console-save
smeserver-tinydns-update
));
}
templates2events("/usr/lib/systemd/system/tinydns.service.d/50koozali.conf", qw(
bootstrap-console-save
smeserver-tinydns-update
));
#--------------------------------------------------
# actions for ip-change event
#--------------------------------------------------
my $event = "ip-change";
safe_symlink("sigusr2", "root/etc/e-smith/events/$event/services2adjust/tinydns");
safe_symlink("reload", "root/etc/e-smith/events/$event/services2adjust/tinydns");
#--------------------------------------------------
# actions for smeserver-tinydns-update event
@@ -31,5 +29,8 @@ safe_symlink("sigusr2", "root/etc/e-smith/events/$event/services2adjust/tinydns"
$event = "smeserver-tinydns-update";
safe_symlink("try-restart", "root/etc/e-smith/events/$event/services2adjust/tinydns");
templates2events("/etc/systemd/system-preset/49-koozali.preset", $event);
templates2events("/usr/lib/systemd/system/tinydns.service.d/50koozali.conf", $event);
templates2events("/etc/rsyslog.conf", $event);
safe_symlink("restart", "root/etc/e-smith/events/$event/services2adjust/rsyslog");
event_link("systemd-reload", $event, "89");

View File

@@ -0,0 +1,3 @@
#tinydns
:programname, isequal, "tinydns" /var/log/tinydns/tinydns.log
& stop

View File

@@ -0,0 +1,7 @@
[Service]
{
my $datalimit = $tinydns{'DataLimit'} || "3000000";
my $ListenIP= $tinydns{'ListenIP'} || "127.0.0.1";
$OUT = "LimitDATA=$datalimit\n";
$OUT .= 'Environment="DATALIMIT='.$datalimit.'" "IP='.$ListenIP.'" GID=53 UID=53 "ROOT=/var/service/tinydns/root"';
}

View File

@@ -1,4 +0,0 @@
{
my $datalimit = $tinydns{'DataLimit'} || "300000";
"$datalimit";
}

View File

@@ -1,3 +0,0 @@
{
$OUT = $tinydns{'ListenIP'} || "127.0.0.1";
}

View File

@@ -0,0 +1,15 @@
/var/log/tinydns/tinydns.log{
weekly
rotate 4
missingok
notifempty
compress
delaycompress
sharedscripts
su root root
create 600 root root
postrotate
/usr/bin/systemctl try-restart tinydns.service >/dev/null 2>&1 || true
endscript
}

View File

@@ -1 +0,0 @@
/var/service/tinydns

View File

@@ -1,15 +1,27 @@
[Unit]
Description=tinydns,
Description=tinydns, A DNS server daemon
Documentation=man:tinydns(8)
After=network.target
Requires=runit.service
After=networking.service
Requires=network.target
[Service]
Type=oneshot
ExecStartPre=/sbin/e-smith/service-status tinydns
ExecStart=/usr/bin/sv u /service/tinydns
ExecStop=/usr/bin/sv stop /service/tinydns
ExecReload=/usr/bin/sv t /service/tinydns
RemainAfterExit=yes
Type=simple
PermissionsStartOnly=true
LimitDATA=3000000
WorkingDirectory=/var/service/tinydns/root
Environment="DATALIMIT=3000000" "IP=127.0.0.1" GID=53 UID=53 "ROOT=/var/service/tinydns/root"
ExecStartPre=/sbin/e-smith/systemd/tinydns-control1
ExecStartPre=/sbin/e-smith/systemd/tinydns-control2
ExecStart=/usr/local/bin/tinydns
ExecReload=/sbin/e-smith/systemd/tinydns-control1
ExecReload=/sbin/e-smith/systemd/tinydns-control2
#ExecReload=/bin/kill -CONT $MAINPID
Restart=always
RestartSec=20s
SyslogIdentifier=tinydns
[Install]
WantedBy=sme-server.target

View File

@@ -1 +0,0 @@
/var/service/tinydns/root

View File

@@ -1,27 +0,0 @@
#!/bin/sh
#----------------------------------------------------------------------
# copyright (C) 1999-2003 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.
#----------------------------------------------------------------------
exec \
/usr/bin/setuidgid dnslog \
/usr/bin/multilog t s5000000 \
/var/log/tinydns

View File

@@ -1,8 +0,0 @@
#!/bin/sh
exec 2>&1
./control/1
exec envdir ./env sh -c '
exec envuidgid dns \
softlimit -d "$DATALIMIT" \
/usr/local/bin/tinydns
'

View File

@@ -4,7 +4,7 @@ Summary: smeserver module to configure tinydns
%define name smeserver-tinydns
Name: %{name}
%define version 11.0.0
%define release 5
%define release 7
Version: %{version}
Release: %{release}%{?dist}
License: GPL
@@ -18,12 +18,22 @@ Requires: smeserver-base
Requires: djbdns
Requires: smeserver-lib >= 1.15.1-19
Requires: smeserver-daemontools >= 1.1.0-02
# daemontools bins in use
Requires: /usr/bin/envuidgid
Requires: /usr/bin/softlimit
Requires: /usr/bin/envdir
Requires: iptables
Obsoletes: tinydns-initscripts
Provides: e-smith-tinydns
AutoReqProv: no
%changelog
* Tue Feb 25 2025 Jean-Philippe Pialasse <jpp@koozali.org> 11.0.0-7.sme
- move to full systemd unit [SME: 12877]
* Sun Jan 26 2025 Jean-Philippe Pialasse <jpp@koozali.org> 11.0.0-6.sme
- requires daemontools bins [SME: 12566]
* Thu Apr 04 2024 Brian Read <brianr@koozali.org> 11.0.0-5.sme
- Set license file to GPL2.0 [SME: 12577]
@@ -421,16 +431,11 @@ rm -rf $RPM_BUILD_ROOT
(cd root ; find . -depth -print | cpio -dump $RPM_BUILD_ROOT)
/sbin/e-smith/genfilelist $RPM_BUILD_ROOT \
--dir /var/service/tinydns 'attr(0755,root,root)' \
--dir /var/service/tinydns/log 'attr(0755,root,root)' \
--file /var/service/tinydns/run 'attr(0750,root,root)' \
--file /var/service/tinydns/tinydns-log.pl 'attr(0750,root,root)' \
--file /var/service/tinydns/tinydns-readstats 'attr(0750,root,root)' \
--file /var/service/tinydns/control/1 'attr(0750,root,root)' \
--file /var/service/tinydns/control/2 'attr(0750,root,root)' \
--file /var/service/tinydns/log/run 'attr(0750,root,root)' \
--file /sbin/e-smith/systemd/tinydns-control1 'attr(0750,root,root)' \
--file /sbin/e-smith/systemd/tinydns-control2 'attr(0750,root,root)' \
--dir /var/log/tinydns 'attr(02755,dnslog,dnslog)' \
--file /var/service/dhcp-dns/dhcp-dns 'attr(0750,root,root)' \
--file /var/service/dhcp-dns/run 'attr(0750,root,root)' \
> %{name}-%{version}-%{release}-filelist
echo "%doc COPYING" >> %{name}-%{version}-%{release}-filelist
@@ -438,6 +443,13 @@ echo "%doc COPYING" >> %{name}-%{version}-%{release}-filelist
rm -rf $RPM_BUILD_ROOT
%pre
if [ $1 -gt 1 ] ; then
if [ -e /var/service/tinydns/run ] ; then
/usr/bin/sv d tinydns
/usr/bin/sv d tinydns/log
fi
fi
/sbin/e-smith/create-system-user dns 53 "Name server" /var/service/tinydns /bin/false
/sbin/e-smith/create-system-user dnslog 411 "DNS log user" /var/log /bin/false
exit 0