public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
* [LTP] [PATCH v2 1/2] at_allow01: Use lib to restart atd service
@ 2012-12-07  3:24 Peng Haitao
  2012-12-07  3:24 ` [LTP] [PATCH v2 2/2] at_deny01: " Peng Haitao
  2012-12-07  7:51 ` [LTP] [PATCH v2 1/2] at_allow01: " Wanlong Gao
  0 siblings, 2 replies; 4+ messages in thread
From: Peng Haitao @ 2012-12-07  3:24 UTC (permalink / raw)
  To: ltp-list

Use restart_daemon() to restart atd service.

Signed-off-by: Peng Haitao <penght@cn.fujitsu.com>
---
 testcases/commands/at/at_allow01 | 18 +++++-------------
 1 file changed, 5 insertions(+), 13 deletions(-)

diff --git a/testcases/commands/at/at_allow01 b/testcases/commands/at/at_allow01
index 43b3428..c0e9335 100755
--- a/testcases/commands/at/at_allow01
+++ b/testcases/commands/at/at_allow01
@@ -38,6 +38,10 @@ test_user1_home="/home/${test_user1}"
 test_user2_home="/home/${test_user2}"
 tmpfile="$TMP/at_allow_test"
 
+if [ "$(id -ru)" = 0 ]; then
+	. cmdlib.sh
+fi
+
 #-----------------------------------------------------------------------
 # FUNCTION:  do_setup
 #-----------------------------------------------------------------------
@@ -80,19 +84,7 @@ do_setup()
 		exit 1
 	fi
 
-	# running under systemd?
-	if command -v systemctl >/dev/null 2>&1; then
-		HAVE_SYSTEMCTL=true
-	else
-		HAVE_SYSTEMCTL=false
-	fi
-
-	# Restart atd daemon.
-	if $HAVE_SYSTEMCTL; then
-		systemctl restart atd.service
-	else
-		/etc/init.d/atd restart
-	fi
+	restart_daemon atd
 }
 
 #-----------------------------------------------------------------------
-- 
1.8.0.1


------------------------------------------------------------------------------
LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
Remotely access PCs and mobile devices and provide instant support
Improve your efficiency, and focus on delivering more value-add services
Discover what IT Professionals Know. Rescue delivers
http://p.sf.net/sfu/logmein_12329d2d
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-12-07  7:59 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-12-07  3:24 [LTP] [PATCH v2 1/2] at_allow01: Use lib to restart atd service Peng Haitao
2012-12-07  3:24 ` [LTP] [PATCH v2 2/2] at_deny01: " Peng Haitao
2012-12-07  7:51   ` Wanlong Gao
2012-12-07  7:51 ` [LTP] [PATCH v2 1/2] at_allow01: " Wanlong Gao

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox