public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: Peng Haitao <penght@cn.fujitsu.com>
To: ltp-list@lists.sourceforge.net
Subject: [LTP] [PATCH 2/2] sssd-lib.sh: fix a bug of sssd daemon is not started
Date: Tue, 9 Jul 2013 16:36:42 +0800	[thread overview]
Message-ID: <1373359002-17618-2-git-send-email-penght@cn.fujitsu.com> (raw)
In-Reply-To: <1373359002-17618-1-git-send-email-penght@cn.fujitsu.com>

If sssd daemon is not started, sssd daemon should be kept stopped.

Signed-off-by: Peng Haitao <penght@cn.fujitsu.com>
---
 testcases/commands/sssd/sssd-lib.sh | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/testcases/commands/sssd/sssd-lib.sh b/testcases/commands/sssd/sssd-lib.sh
index b001904..d63ed6d 100755
--- a/testcases/commands/sssd/sssd-lib.sh
+++ b/testcases/commands/sssd/sssd-lib.sh
@@ -54,7 +54,11 @@ cleanup()
 			mv $NSS_CONFIG_FILE.ltpback $NSS_CONFIG_FILE
 			# Make sure that restart_sssd_daemon doesn't loop
 			# back to cleanup again.
-			restart_sssd_daemon "return 1"
+			if [ $SSSD_STARTED -eq 1 ]; then
+				stop_daemon sssd
+			else
+				restart_sssd_daemon "return 1"
+			fi
 			# Maintain any nonzero exit codes
 			if [ $exit_code -ne $? ]; then
 				exit_code=1
@@ -160,6 +164,12 @@ make_config_file()
 
 . cmdlib.sh
 
+SSSD_STARTED=0
+status_daemon sssd
+if [ $? -ne 0 ]; then
+	SSSD_STARTED=1
+fi
+
 # determine sssd.conf can support override_gid?
 setup
 make_config_file
-- 
1.8.3.1


------------------------------------------------------------------------------
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

  reply	other threads:[~2013-07-09  9:00 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-09  8:36 [LTP] [PATCH 1/2] sssd-lib.sh: Use lib to restart sssd service Peng Haitao
2013-07-09  8:36 ` Peng Haitao [this message]
2013-07-10  2:01   ` [LTP] [PATCH 2/2] sssd-lib.sh: fix a bug of sssd daemon is not started Wanlong Gao
2013-07-10  2:01 ` [LTP] [PATCH 1/2] sssd-lib.sh: Use lib to restart sssd service Wanlong Gao

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1373359002-17618-2-git-send-email-penght@cn.fujitsu.com \
    --to=penght@cn.fujitsu.com \
    --cc=ltp-list@lists.sourceforge.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox