-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathboot.py
More file actions
60 lines (54 loc) · 1.08 KB
/
Copy pathboot.py
File metadata and controls
60 lines (54 loc) · 1.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
import multiprocessing
import time,sys
def mprun():
import IPC
from IPC.multiboot import sgnMpReg,sgnMpWorker
with sgnMpReg().manager as manager:
d = manager.dict()
maindict=d
d['control']=manager.dict({'shutdown':False})
d['service_container']=manager.dict()
d['events']=manager.dict()
d['lock']=manager.RLock()
p = sgnMpWorker('boot',d,'./bootmgr.py')
p.start()
try:
try:
try:
p.join()
#while True:
# time.sleep(10)
except KeyboardInterrupt:
print("CTRL-C")
try:
d.critical('CTRL-C Interrupt')
time.sleep(1)
d['shutdown']=True
time.sleep(1)
except:
pass
finally:
try:
p.shutdown()
except:
pass
except:
pass
if __name__ == '__main__':
multiprocessing.freeze_support()
try:
mprun()
finally:
print("BOOT EXIT!!!")
try:
from systemd import journal
journal.send('[kiosk] **** РАБОТА СИСТЕМЫ ЗАВЕРШЕНА ****')
except:
pass
#p=multiprocessing.Process(target=mprun)
#p.start()
#try:
# p.join()
#finally:
# p.shutdown()
# time.sleep(1.0)