Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
S
scom
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
SulinOS
scom
Commits
00e20fbf
Kaydet (Commit)
00e20fbf
authored
Nis 21, 2008
tarafından
Bahadır Kandemir
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
waitBus after starting D-Bus
üst
d1281372
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
0 deletions
+18
-0
service.py
mudur/bin/service.py
+18
-0
No files found.
mudur/bin/service.py
Dosyayı görüntüle @
00e20fbf
...
...
@@ -14,6 +14,7 @@ import os
import
locale
import
time
import
dbus
import
socket
import
subprocess
# i18n
...
...
@@ -36,6 +37,20 @@ def loadConfig(path):
dict
[
key
]
=
value
return
dict
def
waitBus
(
unix_name
,
timeout
=
10
,
wait
=
0.1
,
stream
=
True
):
if
stream
:
sock
=
socket
.
socket
(
socket
.
AF_UNIX
,
socket
.
SOCK_STREAM
)
else
:
sock
=
socket
.
socket
(
socket
.
AF_UNIX
,
socket
.
SOCK_DGRAM
)
while
timeout
>
0
:
try
:
sock
.
connect
(
unix_name
)
return
True
except
:
timeout
-=
wait
time
.
sleep
(
wait
)
return
False
# Operations
class
Service
:
...
...
@@ -218,6 +233,9 @@ def manage_dbus(op, use_color, quiet):
run
(
"/sbin/start-stop-daemon"
,
"-b"
,
"--start"
,
"--quiet"
,
"--pidfile"
,
"/var/run/dbus/pid"
,
"--exec"
,
"/usr/bin/dbus-daemon"
,
"--"
,
"--system"
)
if
not
waitBus
(
"/var/run/dbus/system_bus_socket"
):
print
_
(
"Unable to start D-Bus"
)
return
elif
op
==
"stop"
:
if
not
quiet
:
print
_
(
"Stopping DBus..."
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment