These days we are working hard on Pardus KDE technologies for our next release “Pardus 2009″; within these tasks first job is porting (and redesigning) our *-manager family to KDE4.
We have a COnfiguration MAnageR called COMAR which uses D-Bus for communication. COMAR provides a powerful and extendible API for managing anything such as package, network, x.org, bootloader, disk or system service which are also described in model.xml.
From COMAR.Api.qt4 example:
import comar
# Create link
self.link = comar.Link()
def handler(package, exception, results):
# do something with these info..
print package, results
# Get all services from comar
link.System.Service.info(async=handler)
It will get you all services status and their info asynchronously to the handler method. Also if you want to start “openssh” service you can call it like;
link.System.Service["openssh"].start()
When you do this, COMAR will call the PolicyKit-KDE(3) and asks password if you have privileges for this action.(I will show it in action)
Yes, COM

#1 by Bahadır Kandemir on 19 November, 2008 - 12:56
BTW, comar.Link() is a wrapper to communicate COMAR over DBus.
link.System.Service["apache"].info() is simply calling tr.org.pardus.comar.System.Service.info method of /package/apache
#2 by John Tapsell on 19 November, 2008 - 16:08
Is it possible for an external app to get the PIDs of the running services?
#3 by Gökmen Göksel on 19 November, 2008 - 16:17
Yes, but I actually don’t understand your question :)
#4 by Ömer F. USTA on 19 November, 2008 - 18:50
Selam
DBusQtMainLoop(set_as_default=True kısmında
Açılmış parantezin kapatılması unutulmuş.
John ise herhangi bir comar cağrısı ile daha önce
çalıştırılmış bir servisin pid numarasını öğrenebilirmiyiz diye sormak istemiş yani diyelim biz …… .info () ile servis hakkında bilgi alabiliyoruz ya aynı şekilde o servisin pid numarasını öğrenebilir miyiz demiş yani .info().pid() gibi
#5 by Gökmen Göksel on 19 November, 2008 - 20:16
@Ömer
Düzelttim teşekkürler fakat hala senin düşündüğün gibi sorduğundan emin değilim, çünkü böyle bir şey mümkün mü derken external app demiş kendisi çomar’ı mı kastediyor pek anlayamadım :)
Eğer çomarı kastediyorsa yok böyle bir yetenek tabi ;)
#6 by Ömer F. USTA on 20 November, 2008 - 6:35
Kendi düşüncem harici bir uygulamayla dbus üzerinden comarda ilgili methodu uzaktan çağırıp ( ki zaten dbus bunun için) istediği herhangi bir servisin pid numarasını almak istiyor gibi geldi bana.
Bu ne işe yarayabilir ? pek emin değilim :D belki ilgili servisin pid numarası üzerinden kullandığı sistem kaynaklarını gösterecek bir uygulama filan yazmak istiyordur.
#7 by Bahadır Kandemir on 20 November, 2008 - 9:49
@John: COMAR gives name, description and status of the service only.
#8 by Paulo Fidalgo on 20 November, 2008 - 13:02
Well, I think this could be refactored (to be distro agnostic) to get an inclusion on KDE, maybe in KDE playground first…
It will be a nice feature to have… at least I miss this in Kubuntu and Fedora.
#9 by Gökmen Göksel on 20 November, 2008 - 13:09
@Paulo
It is possible to start it from KDE/playground, but for now it needs COMAR base system which just using by Pardus.
On the other hands it will go another way :)
#10 by Faik Uygur on 20 November, 2008 - 16:05
@Paulo: Try Pardus :)
#11 by Fatih Aşıcı on 25 November, 2008 - 19:15
I think, It should be renamed to “System Services”. KDE already has a module named “Service Manager”.