summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAaron W. Swenson <titanofold@gentoo.org>2011-11-13 16:42:02 +0000
committerAaron W. Swenson <titanofold@gentoo.org>2011-11-13 16:42:02 +0000
commit8093f485dc32ca6110e8e759cb4f7b8c2e1cc48d (patch)
tree14ef96c96b7d48bf953b16fb328e92ed57461f48 /net-dns/ddclient/files
parentFix init.d typo #390381 by Helmut Jarausch. (diff)
downloadgentoo-2-8093f485dc32ca6110e8e759cb4f7b8c2e1cc48d.tar.gz
gentoo-2-8093f485dc32ca6110e8e759cb4f7b8c2e1cc48d.tar.bz2
gentoo-2-8093f485dc32ca6110e8e759cb4f7b8c2e1cc48d.zip
Fixes bug 386161. Initscript now creates (/var)?/run/ddclient folder for those on tmpfs.
(Portage version: 2.1.10.11/cvs/Linux i686)
Diffstat (limited to 'net-dns/ddclient/files')
-rw-r--r--net-dns/ddclient/files/cmd-over-cfg.patch11
-rw-r--r--net-dns/ddclient/files/ddclient.confd-r12
-rw-r--r--net-dns/ddclient/files/ddclient.initd-r358
3 files changed, 71 insertions, 0 deletions
diff --git a/net-dns/ddclient/files/cmd-over-cfg.patch b/net-dns/ddclient/files/cmd-over-cfg.patch
new file mode 100644
index 000000000000..9033873fde74
--- /dev/null
+++ b/net-dns/ddclient/files/cmd-over-cfg.patch
@@ -0,0 +1,11 @@
+--- ddclient.old 2011-11-13 10:14:59.957846596 -0500
++++ ddclient 2011-11-13 10:18:33.864245944 -0500
+@@ -773,7 +773,7 @@
+ foreach my $h (sort keys %config) {
+ next if $config{$h}{'protocol'} ne lc($s);
+ $examined{$h} = 1;
+- my $use = $config{$h}{'use'} || opt('use');
++ my $use = opt('use') || $config{$h}{'use'};
+ local $opt{$use} = $config{$h}{$use} if $config{$h}{$use};
+ # bug #13: we should only do this once
+ # use isn't enough, we have to save the origin to.
diff --git a/net-dns/ddclient/files/ddclient.confd-r1 b/net-dns/ddclient/files/ddclient.confd-r1
new file mode 100644
index 000000000000..69ad0eeff87d
--- /dev/null
+++ b/net-dns/ddclient/files/ddclient.confd-r1
@@ -0,0 +1,2 @@
+# No need to specify a pid in /etc/ddclient/ddclient.conf
+#PIDFILE=/var/run/ddclient/ddclient.pid
diff --git a/net-dns/ddclient/files/ddclient.initd-r3 b/net-dns/ddclient/files/ddclient.initd-r3
new file mode 100644
index 000000000000..2fe7c5bd4f75
--- /dev/null
+++ b/net-dns/ddclient/files/ddclient.initd-r3
@@ -0,0 +1,58 @@
+#!/sbin/runscript
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-dns/ddclient/files/ddclient.initd-r3,v 1.1 2011/11/13 16:42:02 titanofold Exp $
+
+if [ -d /run ] ; then
+ PIDFILE=${PIDFILE:-/run/ddclient/ddclient.pid}
+else
+ PIDFILE=${PIDFILE:-/var/run/ddclient/ddclient.pid}
+fi
+
+depend() {
+ before cron
+ need net
+ use dns logger squid
+}
+
+checkconfig() {
+ local conf="/etc/ddclient/ddclient.conf"
+
+ if [ -e "${conf}" ] ; then
+ if [ -n "$(find /etc/ddclient -maxdepth 1 -name ddclient.conf -perm +0044)" ] ; then
+ eerror "${conf} must not be world or group readable. Try:"
+ eerror " chmod 600 ${conf}"
+ eerror " chown ddclient:ddclient ${conf}"
+ return 1
+ fi
+ else
+ eerror "${conf} is needed to run ddclient"
+ eerror "There is a sample file in /etc/ddclient/"
+ return 1
+ fi
+}
+
+start() {
+ checkconfig || return 1
+
+ local piddir=$(dirname ${PIDFILE})
+ if [ ! -d ${piddir} ] ; then
+ ebegin "Making ${piddir}"
+ mkdir -p ${piddir}
+ eend $?
+ ebegin "Changing permissions of ${piddir}"
+ chown ddclient:ddclient ${piddir}
+ eend $?
+ fi
+
+ ebegin "Starting ${SVCNAME}"
+ start-stop-daemon --start --user ddclient --exec /usr/sbin/ddclient \
+ --name ddclient --pidfile ${PIDFILE} -- -pid=${PIDFILE}
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping ${SVCNAME}"
+ start-stop-daemon --stop --signal USR1 --pidfile ${PIDFILE}
+ eend $?
+}