Patchwork [3/5] bind: add init.d/bind status command

login
register
mail settings
Submitter Yue Tao
Date Nov. 27, 2013, 7:55 a.m.
Message ID <1385538944-8585-3-git-send-email-Yue.Tao@windriver.com>
Download mbox | patch
Permalink /patch/62455/
State New
Headers show

Comments

Yue Tao - Nov. 27, 2013, 7:55 a.m.
Signed-off-by: Yue Tao <Yue.Tao@windriver.com>
---
 .../bind-add-init-bind-status-command.patch        |   45 ++++++++++++++++++++
 meta/recipes-connectivity/bind/bind_9.8.1.bb       |    3 +-
 2 files changed, 47 insertions(+), 1 deletions(-)
 create mode 100644 meta/recipes-connectivity/bind/bind-9.8.1/bind-add-init-bind-status-command.patch
Richard Purdie - Nov. 27, 2013, 11:58 a.m.
On Wed, 2013-11-27 at 15:55 +0800, Yue Tao wrote:
> Signed-off-by: Yue Tao <Yue.Tao@windriver.com>
> ---
>  .../bind-add-init-bind-status-command.patch        |   45 ++++++++++++++++++++
>  meta/recipes-connectivity/bind/bind_9.8.1.bb       |    3 +-
>  2 files changed, 47 insertions(+), 1 deletions(-)
>  create mode 100644 meta/recipes-connectivity/bind/bind-9.8.1/bind-add-init-bind-status-command.patch
> 
> diff --git a/meta/recipes-connectivity/bind/bind-9.8.1/bind-add-init-bind-status-command.patch b/meta/recipes-connectivity/bind/bind-9.8.1/bind-add-init-bind-status-command.patch
> new file mode 100644
> index 0000000..8ed3c56
> --- /dev/null
> +++ b/meta/recipes-connectivity/bind/bind-9.8.1/bind-add-init-bind-status-command.patch
> @@ -0,0 +1,45 @@
> +--- a/init.d
> ++++ b/init.d
> +@@ -2,6 +2,8 @@

No patch header...

Cheers,

Richard

Patch

diff --git a/meta/recipes-connectivity/bind/bind-9.8.1/bind-add-init-bind-status-command.patch b/meta/recipes-connectivity/bind/bind-9.8.1/bind-add-init-bind-status-command.patch
new file mode 100644
index 0000000..8ed3c56
--- /dev/null
+++ b/meta/recipes-connectivity/bind/bind-9.8.1/bind-add-init-bind-status-command.patch
@@ -0,0 +1,45 @@ 
+--- a/init.d
++++ b/init.d
+@@ -2,6 +2,8 @@
+ 
+ PATH=/sbin:/bin:/usr/sbin:/usr/bin
+ 
++. /etc/init.d/functions
++
+ # for a chrooted server: "-u bind -t /var/lib/named"
+ # Don't modify this line, change or create /etc/default/bind9.
+ OPTIONS=""
+@@ -104,6 +106,12 @@ umount_chroot_conf() {
+     fi
+ }
+ 
++rhstatus() {
++  [ -x /usr/sbin/rndc ] && /usr/sbin/rndc status;
++  status /usr/sbin/named;
++  return $?
++}
++
+ case "$1" in
+     start)
+ 	echo -n "Starting domain name service: named"
+@@ -172,6 +180,11 @@ case "$1" in
+ 	echo "."	
+     ;;
+ 
++    status)
++	rhstatus;
++	exit $?
++    ;;
++
+     reload)
+ 	/usr/sbin/rndc reload
+     ;;
+@@ -183,7 +196,7 @@ case "$1" in
+     ;;
+     
+     *)
+-	echo "Usage: /etc/init.d/bind {start|stop|reload|restart|force-reload}" >&2
++	echo "Usage: /etc/init.d/bind {start|stop|reload|restart|status|force-reload}" >&2
+ 	exit 1
+     ;;
+ esac
diff --git a/meta/recipes-connectivity/bind/bind_9.8.1.bb b/meta/recipes-connectivity/bind/bind_9.8.1.bb
index 5919c21..2f72554 100644
--- a/meta/recipes-connectivity/bind/bind_9.8.1.bb
+++ b/meta/recipes-connectivity/bind/bind_9.8.1.bb
@@ -6,7 +6,7 @@  LICENSE = "ISC & BSD"
 LIC_FILES_CHKSUM = "file://COPYRIGHT;md5=0fbe2a3ab3c68ac3fea3cad13093877c"
 
 DEPENDS = "openssl libcap"
-PR = "r5"
+PR = "r6"
 
 SRC_URI = "ftp://ftp.isc.org/isc/bind9/${PV}/${BPN}-${PV}.tar.gz \
            file://conf.patch \
@@ -19,6 +19,7 @@  SRC_URI = "ftp://ftp.isc.org/isc/bind9/${PV}/${BPN}-${PV}.tar.gz \
            file://bind-CVE-2013-2266.patch \
            file://bind-Fix-CVE-2012-4244.patch \
            file://mips1-not-support-opcode.diff \
+           file://bind-add-init-bind-status-command.patch \
 	   "
 
 SRC_URI[md5sum] = "cf31117c5d35af34d4c0702970ad9fb7"