Patchwork openssh: fix sshd status command error prompt

login
register
mail settings
Submitter Qiang Chen
Date Oct. 18, 2013, 8:50 a.m.
Message ID <1382086221-19473-1-git-send-email-qiang.chen@windriver.com>
Download mbox | patch
Permalink /patch/60223/
State Accepted
Commit 63534ab9679d89ef617e8598d27d17d6a57cbf8b
Headers show

Comments

Qiang Chen - Oct. 18, 2013, 8:50 a.m.
sshd status command results in error prompt:

root@qemu0:~# /etc/init.d/sshd status
/usr/sbin/sshd (pid 1199) is running...
/etc/init.d/sshd: line 100: return: can only `return' from a
function or sourced script

"service --status-all" command also display wrong status for sshd.

This commit fix this error prompt and make service command display
right status for sshd.

Signed-off-by: Qiang Chen <qiang.chen@windriver.com>
---
 .../openssh/openssh-6.2p2/init                     |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch

diff --git a/meta/recipes-connectivity/openssh/openssh-6.2p2/init b/meta/recipes-connectivity/openssh/openssh-6.2p2/init
index 266689c..e7f3971 100644
--- a/meta/recipes-connectivity/openssh/openssh-6.2p2/init
+++ b/meta/recipes-connectivity/openssh/openssh-6.2p2/init
@@ -97,7 +97,7 @@  case "$1" in
 
   status)
 	status /usr/sbin/sshd
-	return $?
+	exit $?
   ;;
 
   *)