forked from kushaldas/darkserver
-
Notifications
You must be signed in to change notification settings - Fork 0
/
darkbuildqueue
executable file
·36 lines (31 loc) · 924 Bytes
/
darkbuildqueue
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
#!/usr/bin/env python
import os
import sys
from darkimporter.darkdaemon import Daemon
from darkimporter.libimporter import monitor_buildqueue
from darkimporter.libimporter import create_rundir
class DarkDaemon(Daemon):
def run(self):
"""
The daemon process
"""
monitor_buildqueue()
if __name__ == '__main__':
daemon = None
create_rundir()
if len(sys.argv) == 2:
daemon = DarkDaemon('/var/run/darkserver/darkbuildqueue.pid')
if 'start' == sys.argv[1]:
daemon.start()
else:
print "Unknown command"
sys.exit(2)
sys.exit(0)
if len(sys.argv) == 3:
if 'start' == sys.argv[1]:
daemon = DarkDaemon('/var/run/darkserver/darkbuildqueue%s.pid' % sys.arv[2])
daemon.start()
sys.exit(0)
else:
print "usage: %s start" % sys.argv[0]
sys.exit(2)