aboutsummaryrefslogtreecommitdiffstats
path: root/dns/maradns
diff options
context:
space:
mode:
authorpav <pav@FreeBSD.org>2007-06-16 20:42:14 +0800
committerpav <pav@FreeBSD.org>2007-06-16 20:42:14 +0800
commit2bd3c1b2a5304a7c757b8481d3d76990b3a552cb (patch)
treefeaa2730d3125c494b497f4ea451d62811902241 /dns/maradns
parentbf72e782c43d288430ddb6548cc2be34dd50b0a8 (diff)
downloadfreebsd-ports-gnome-2bd3c1b2a5304a7c757b8481d3d76990b3a552cb.tar.gz
freebsd-ports-gnome-2bd3c1b2a5304a7c757b8481d3d76990b3a552cb.tar.zst
freebsd-ports-gnome-2bd3c1b2a5304a7c757b8481d3d76990b3a552cb.zip
- change duende source to create PID file by itself
- maradns.sh and zoneserver.sh now use PID file - change default MaraDNS UID from 99 to bind(53) - change default maraDNS GID from 99 to bind(53) - change default duende logger process UID from 66 to nobody(65534) - create empty etc/logger directory PR: ports/113235 Submitted by: Simun Mikecin <numisemis@yahoo.com> Approved by: Alex Kapranoff <alex@kapranoff.ru> (maintainer)
Diffstat (limited to 'dns/maradns')
-rw-r--r--dns/maradns/Makefile2
-rw-r--r--dns/maradns/files/patch-MaraDns.h22
-rw-r--r--dns/maradns/files/patch-tools_Makefile11
-rw-r--r--dns/maradns/files/patch-tools_duende.c52
-rw-r--r--dns/maradns/files/rc_d.sh6
-rw-r--r--dns/maradns/pkg-plist2
6 files changed, 92 insertions, 3 deletions
diff --git a/dns/maradns/Makefile b/dns/maradns/Makefile
index 6956a7c5cf2d..2296e34f5035 100644
--- a/dns/maradns/Makefile
+++ b/dns/maradns/Makefile
@@ -7,6 +7,7 @@
PORTNAME= maradns
PORTVERSION= 1.2.12.06
+PORTREVISION= 1
CATEGORIES= dns
MASTER_SITES= http://www.maradns.org/download/1.2/${PORTVERSION}/ \
http://kapranoff.ru/~kappa/files/
@@ -57,6 +58,7 @@ do-install:
${MKDIR} ${PREFIX}/etc/maradns
${INSTALL_DATA} ${WRKSRC}/doc/en/examples/example_csv2 \
${PREFIX}/etc/maradns/example_csv2
+ ${MKDIR} ${PREFIX}/etc/maradns/logger
@${SED} ${RC_SCRIPTS_SUB:S/$/!g/:S/^/ -e s!%%/:S/=/%%!/} \
'-e s!%%SERVICE%%!maradns!g' \
${FILESDIR}/rc_d.sh > ${PREFIX}/etc/rc.d/maradns.sh
diff --git a/dns/maradns/files/patch-MaraDns.h b/dns/maradns/files/patch-MaraDns.h
new file mode 100644
index 000000000000..45ff326b37f7
--- /dev/null
+++ b/dns/maradns/files/patch-MaraDns.h
@@ -0,0 +1,22 @@
+--- MaraDns.h.orig Sat Jun 2 13:46:12 2007
++++ MaraDns.h Sat Jun 2 13:47:12 2007
+@@ -75,16 +75,16 @@
+ line to point to Bash
+ */
+
+-#define MARADNS_DEFAULT_UID 99
++#define MARADNS_DEFAULT_UID 53
+
+ /* The default GID (Group ID) that MaraDNS has; see the default UID notes
+ above. Again: CHANGE THE MARARC MAN PAGE IF YOU CHANGE THIS VALUE */
+-#define MARADNS_DEFAULT_GID 99
++#define MARADNS_DEFAULT_GID 53
+
+ /* The UID that the Duende logging process uses. CHANGE THE DUENDE MAN
+ PAGE IF YOU CHANGE THIS VALUE (same general process as changing the
+ mararc man page; the source file for the duende man page is duende.ej) */
+-#define DUENDE_LOGGER_UID 66
++#define DUENDE_LOGGER_UID 65534
+
+ /* The directory that Duende runs in. This directory has to exist for
+ Duende to be able to run. Again, IF YOU CHANGE THIS, CHANGE THE
diff --git a/dns/maradns/files/patch-tools_Makefile b/dns/maradns/files/patch-tools_Makefile
new file mode 100644
index 000000000000..f6074fa14dfa
--- /dev/null
+++ b/dns/maradns/files/patch-tools_Makefile
@@ -0,0 +1,11 @@
+--- tools/Makefile.orig Sat Jun 2 13:33:56 2007
++++ tools/Makefile Sat Jun 2 13:38:09 2007
+@@ -27,7 +27,7 @@
+ $(CC) $(FLAGS) -o benchmark benchmark.c $(OBJECTS) $(POBJECTS)
+
+ duende: duende.c
+- $(CC) $(FLAGS) -o duende duende.c
++ $(CC) $(FLAGS) -o duende duende.c -lutil
+
+ strip.control: strip.control.c
+ $(CC) $(FLAGS) -o strip.control strip.control.c
diff --git a/dns/maradns/files/patch-tools_duende.c b/dns/maradns/files/patch-tools_duende.c
new file mode 100644
index 000000000000..17b4fc5c1b65
--- /dev/null
+++ b/dns/maradns/files/patch-tools_duende.c
@@ -0,0 +1,52 @@
+--- tools/duende.c.orig Sat Jun 2 13:40:35 2007
++++ tools/duende.c Sat Jun 2 13:41:01 2007
+@@ -35,10 +35,13 @@
+ #include <signal.h>
+ #include <stdio.h>
+ #include <stdlib.h>
++#include <string.h>
+ #include <syslog.h>
++#include <sys/param.h>
+ #include <sys/time.h>
+ #include <sys/types.h>
+ #include <sys/wait.h>
++#include <libutil.h>
+ #include <unistd.h>
+ #include "../MaraDns.h"
+
+@@ -139,6 +142,9 @@
+ int exit_status;
+ pid_t pid, log_pid;
+ int stream1[2]; /* Used for piping */
++ struct pidfh *pfh;
++ char *name;
++ char *pidfile;
+ if(argv[0] == NULL || argv[1] == NULL) {
+ printf("Usage: duende [program] [arguments]\n");
+ exit(1);
+@@ -202,7 +208,24 @@
+ log_helper(argv[1],stream1[0]);
+ syslog(LOG_ALERT,"log_helper finished, terminating\n");
+ exit(1);
+- }
++ }
++
++ name = strrchr(argv[1], '/');
++ if (name && *name != '\0') {
++ pidfile = malloc(strlen("/var/run/") + strlen(name) + strlen(".pid") + 1);
++ if (pidfile) {
++ strcpy(pidfile, "/var/run/");
++ strcat(pidfile, name);
++ strcat(pidfile, ".pid");
++ remove(pidfile);
++ pfh = pidfile_open(pidfile, 0600, &pid);
++ if (pfh) {
++ pidfile_write(pfh);
++ pidfile_close(pfh);
++ }
++ free(pidfile);
++ }
++ }
+ for(;;) {
+ /* If we got a HUP signal, send it to the child */
+ if(got_hup_signal == 1) {
diff --git a/dns/maradns/files/rc_d.sh b/dns/maradns/files/rc_d.sh
index b5aebb3680da..349635befd51 100644
--- a/dns/maradns/files/rc_d.sh
+++ b/dns/maradns/files/rc_d.sh
@@ -28,11 +28,11 @@ prefix=%%PREFIX%%
name="%%SERVICE%%"
rcvar=`set_rcvar`
-command="${prefix}/sbin/${name}"
-command_args="| /usr/bin/logger -p daemon.notice -t %%SERVICE%% &"
+command="${prefix}/bin/duende"
+pidfile="/var/run/${name}.pid"
load_rc_config $name
-flags="${%%SERVICE%%_flags}"
+flags="${prefix}/sbin/${name} ${%%SERVICE%%_flags}"
run_rc_command "$1"
diff --git a/dns/maradns/pkg-plist b/dns/maradns/pkg-plist
index d7c203ba34dd..cf8ee951e3b8 100644
--- a/dns/maradns/pkg-plist
+++ b/dns/maradns/pkg-plist
@@ -7,6 +7,8 @@ etc/mararc.sample
etc/rc.d/maradns.sh
etc/rc.d/zoneserver.sh
etc/maradns/example_csv2
+@exec mkdir -p %D/etc/maradns/logger
+@dirrmtry etc/maradns/logger
@dirrmtry etc/maradns
sbin/maradns
sbin/zoneserver