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

Khem Raj raj.khem at gmail.com
Thu Aug 22 06:42:47 UTC 2013


Hi Jackie

One thing comes to mind is that these scripts are hardcoding the binaries and may be it would be
nicer to replace the bindir, libdir and so on at install time, that would make them flexible where /usr
is not used e.g. but I guess thats a general problem with capture init scripts all around probably.

On Aug 19, 2013, at 8:25 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                     |   15 ++++++++++++++-
> 1 files changed, 14 insertions(+), 1 deletions(-)
> 
> diff --git a/meta/recipes-connectivity/openssh/openssh-6.2p2/init b/meta/recipes-connectivity/openssh/openssh-6.2p2/init
> index 6beec84..6bbc573 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
> @@ -46,6 +49,11 @@ check_keys() {
> 	fi
> }
> 
> +rh_status() {
> +	status /usr/sbin/sshd;
> +	return $?
> +}
> +
> export PATH="${PATH:+$PATH:}/usr/sbin:/sbin"
> 
> case "$1" in
> @@ -84,8 +92,13 @@ case "$1" in
> 	echo "."
> 	;;
> 
> +  status)
> +	rh_status;
> +	exit $?
> +  ;;
> +
>   *)
> -	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
> 
> -- 
> 1.7.4.1
> 
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core at lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-core




More information about the Openembedded-core mailing list