[Uludag-commits] r11966 - trunk/comar/mudur/bin

svn-uludag at uludag.org.tr svn-uludag at uludag.org.tr
13 Oca 2007 Cmt 16:41:47 EET


Author: caglar
Date: Sat Jan 13 16:41:46 2007
New Revision: 11966

Modified:
   trunk/comar/mudur/bin/service.py
Log:
Stefan Seyfried <seife _at_ suse.de> writes;

i always believed "service" was a LSB thing, but could not find it in the 3.1
specification.
On SUSE systems, "service foo {start|stop|restart|status}" just calls the
init script, which has to support "status" anyway. I don't know about the
Pardus init scripts, but wouldn't it be, in the long term, better for you
if you just made your "service" behave like the "rest of the world"? :-)
Means: a patch to "service" to take "status" as an alias for "info" would
probably be as easy as patching this into pm-utils :-)

I might be wrong here, of course, and i am not LSB-enlightened at all.

So status added as an alias :)



Modified: trunk/comar/mudur/bin/service.py
=================================================================
--- trunk/comar/mudur/bin/service.py	(original)
+++ trunk/comar/mudur/bin/service.py	Sat Jan 13 16:41:46 2007
@@ -182,7 +182,7 @@
         c.System.Service[service].setState(state="on")
     elif op == "off":
         c.System.Service[service].setState(state="off")
-    elif op == "info" or op == "list":
+    elif op in ["info", "status", "list"]:
         c.System.Service[service].info()
     elif op == "restart":
         manage_service(service, "stop")
@@ -198,7 +198,7 @@
         print _("Service '%s' started.") % service
     elif op == "stop":
         print _("Service '%s' stopped.") % service
-    elif op == "info" or op == "list":
+    elif op in ["info", "status", "list"]:
         s = Service(reply.script, reply.data)
         format_service_list([s], use_color)
     elif op == "reload":
@@ -214,6 +214,7 @@
     print _("""usage: service [<service>] <command>
 where command is:
  list    Display service list
+ status  Display service status
  info    Display service status
  on      Auto start the service
  off     Don't auto start the service
@@ -225,7 +226,7 @@
 # Main
 
 def main(args):
-    operations = ("start", "stop", "info", "list", "restart", "reload", "on", "off")
+    operations = ("start", "stop", "info", "list", "restart", "reload", "status", "on", "off")
     use_color = True
     
     # Parameters


Uludag-commits mesaj listesiyle ilgili daha fazla bilgi