[OE-core] [PATCH 6/6] openssh: add init.d/sshd status command for LSB compliance

Saul Wold sgw at linux.intel.com
Wed Aug 21 17:34:24 UTC 2013


On 08/20/2013 11:15 PM, jackie.huang at windriver.com wrote:
> From: Jackie Huang <jackie.huang at windriver.com>
>
> Signed-off-by: Li Wang <li.wang at windriver.com>
> Signed-off-by: Jackie Huang <jackie.huang at windriver.com>
> ---
>   .../openssh/openssh-6.2p2/init                     |   14 +++++++++++++-
>   1 files changed, 13 insertions(+), 1 deletions(-)
>
> diff --git a/meta/recipes-connectivity/openssh/openssh-6.2p2/init b/meta/recipes-connectivity/openssh/openssh-6.2p2/init
> index 12fb79b..72c5822 100644
> --- a/meta/recipes-connectivity/openssh/openssh-6.2p2/init
> +++ b/meta/recipes-connectivity/openssh/openssh-6.2p2/init
> @@ -1,6 +1,9 @@
>   #! /bin/sh
>   set -e
>
> +# source function library
> +. /etc/init.d/functions
> +
>   # /etc/init.d/ssh: start and stop the OpenBSD "secure shell" daemon
>
>   test -x /usr/sbin/sshd || exit 0
> @@ -54,6 +57,11 @@ check_keys() {
>   	fi
>   }
>
> +rh_status() {
> +	status /usr/sbin/sshd
> +	return $?
> +}
> +
>   export PATH="${PATH:+$PATH:}/usr/sbin:/sbin"
>
>   case "$1" in
> @@ -92,8 +100,12 @@ case "$1" in
>   	echo "."
>   	;;
>
> +  status)
> +	rh_status

Why rh_status here and in the "at" script?  Can't you just do the status 
/usr/bin/sshd directly here?

> +  ;;
> +
>     *)
> -	echo "Usage: /etc/init.d/ssh {start|stop|reload|force-reload|restart}"
> +	echo "Usage: /etc/init.d/ssh {start|stop|status|reload|force-reload|restart}"
>   	exit 1
>   esac
>
>



More information about the Openembedded-core mailing list