summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomas Chvatal <scarabeus@gentoo.org>2013-08-21 09:23:59 +0000
committerTomas Chvatal <scarabeus@gentoo.org>2013-08-21 09:23:59 +0000
commit80bfc9862beb5a6dc73b3453a6e99bc403591caf (patch)
treecaba422f8949932590edb2c0f6414337d6f52b67 /net-dns
parentversion bump, drop old (diff)
downloadgentoo-2-80bfc9862beb5a6dc73b3453a6e99bc403591caf.tar.gz
gentoo-2-80bfc9862beb5a6dc73b3453a6e99bc403591caf.tar.bz2
gentoo-2-80bfc9862beb5a6dc73b3453a6e99bc403591caf.zip
Update initscript so it actually works. Again thanks to Ondrej.
(Portage version: 2.2.0/cvs/Linux x86_64, signed Manifest commit with key 8EEE3BE8)
Diffstat (limited to 'net-dns')
-rw-r--r--net-dns/knot/ChangeLog8
-rw-r--r--net-dns/knot/files/knot.init51
-rw-r--r--net-dns/knot/knot-1.3.0-r1.ebuild (renamed from net-dns/knot/knot-1.3.0.ebuild)2
3 files changed, 33 insertions, 28 deletions
diff --git a/net-dns/knot/ChangeLog b/net-dns/knot/ChangeLog
index 40a33242226d..237238e5adf3 100644
--- a/net-dns/knot/ChangeLog
+++ b/net-dns/knot/ChangeLog
@@ -1,6 +1,12 @@
# ChangeLog for net-dns/knot
# Copyright 1999-2013 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/net-dns/knot/ChangeLog,v 1.19 2013/08/21 08:21:19 scarabeus Exp $
+# $Header: /var/cvsroot/gentoo-x86/net-dns/knot/ChangeLog,v 1.20 2013/08/21 09:23:59 scarabeus Exp $
+
+*knot-1.3.0-r1 (21 Aug 2013)
+
+ 21 Aug 2013; Tomáš Chvátal <scarabeus@gentoo.org> +knot-1.3.0-r1.ebuild,
+ -knot-1.3.0.ebuild, files/knot.init:
+ Update initscript so it actually works. Again thanks to Ondrej.
*knot-1.3.0 (21 Aug 2013)
diff --git a/net-dns/knot/files/knot.init b/net-dns/knot/files/knot.init
index cf73f6240454..42eae81844e1 100644
--- a/net-dns/knot/files/knot.init
+++ b/net-dns/knot/files/knot.init
@@ -1,43 +1,42 @@
#!/sbin/runscript
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-dns/knot/files/knot.init,v 1.2 2013/08/21 09:23:59 scarabeus Exp $
+
+command=/usr/sbin/knotd
+command_args="-d"
+pidfile=/var/run/knot/knot.pid
+required_files=/etc/knot/knot.conf
+extra_started_commands="reload"
+description_reload="Reload configuration and changed zones."
depend() {
need net
}
-check_config() {
- # we need to ensure that var is created for runtime
- if [ ! -d /var/lib/knot/ ]; then
- mkdir -p /var/lib/knot/
- fi
- # without config dns is kinda useless
- if [ ! -f /etc/knot/knot.conf ]; then
- eerror "This script requires configured knot-dns at /etc/knot/knot.conf."
- return 1
- fi
-}
-
start() {
- check_config || return 1
+ checkpath -d -m 0750 -o knot:knot /var/run/knot/ /var/lib/knot/
- ebegin "Starting knot-dns"
- /usr/sbin/knotc start
+ ebegin "Starting knot"
+ start-stop-daemon --start \
+ --pidfile $pidfile --exec $command -- $command_args
eend $?
}
stop() {
- ebegin "Stoping knot-dns"
- /usr/sbin/knotc stop
- eend $?
-}
-
-restart() {
- ebegin "Restarting knot-dns"
- /usr/sbin/knotc restart
- eend $?
+ ebegin "Stoping knot"
+ /usr/sbin/knotc stop >/dev/null 2>&1
+ # In case remote control is not working
+ if [ "$?" != 0 ]; then
+ if [ -f $pidfile ]; then
+ start-stop-daemon --stop --pidfile $pidfile
+ fi
+ fi
+ ewend $?
}
reload() {
- ebegin "Reloading knot-dns"
- /usr/sbin/knotc reload
+ ebegin "Reloading knot"
+ /usr/sbin/knotc reload >/dev/null
eend $?
}
diff --git a/net-dns/knot/knot-1.3.0.ebuild b/net-dns/knot/knot-1.3.0-r1.ebuild
index 0ded794ee49f..3df494d0bcf3 100644
--- a/net-dns/knot/knot-1.3.0.ebuild
+++ b/net-dns/knot/knot-1.3.0-r1.ebuild
@@ -1,6 +1,6 @@
# Copyright 1999-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/net-dns/knot/knot-1.3.0.ebuild,v 1.1 2013/08/21 08:21:18 scarabeus Exp $
+# $Header: /var/cvsroot/gentoo-x86/net-dns/knot/knot-1.3.0-r1.ebuild,v 1.1 2013/08/21 09:23:59 scarabeus Exp $
EAPI=5