[Pm-utils] [PATCH] Fix restartservice return code for stopped services

Andrey Borzenkov arvidjaar at mail.ru
Sat Oct 11 05:24:09 PDT 2008


If service was not active at suspend, currently restartservice
return an error which results in annoying popups that suspend
failed. Make sure we return success if there was nothing to do.

Signed-off-by: Andrey Borzenkov <arvidjaar at mail.ru>

---

 pm/functions.in |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)


diff --git a/pm/functions.in b/pm/functions.in
index 110282e..29e58cb 100644
--- a/pm/functions.in
+++ b/pm/functions.in
@@ -150,7 +150,11 @@ stopservice()
 
 restartservice()
 {
-	[ -O "${STORAGEDIR}/service:$1" ] && service "$1" start
+	if [ -O "${STORAGEDIR}/service:$1" ]; then
+	       	service "$1" start
+	else 
+		return 0
+	fi
 }
 
 # Disable a hook.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part.
Url : http://lists.freedesktop.org/archives/pm-utils/attachments/20081011/0eee96b2/attachment.pgp 


More information about the Pm-utils mailing list