Delete daeRun.py
This commit is contained in:
parent
80cd002bf1
commit
d3e931bd6b
34
daeRun.py
34
daeRun.py
|
@ -1,34 +0,0 @@
|
||||||
#!/usr/bin/env python
|
|
||||||
|
|
||||||
import sys, time
|
|
||||||
from daemon import Daemon
|
|
||||||
from infoRet import get_data_rss
|
|
||||||
|
|
||||||
|
|
||||||
class MyDaemon(Daemon):
|
|
||||||
def run(self):
|
|
||||||
while True:
|
|
||||||
time.sleep(1)
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
|
||||||
daemon = MyDaemon('/tmp/daemon-example.pid')
|
|
||||||
if len(sys.argv) == 2:
|
|
||||||
if 'start' == sys.argv[1]:
|
|
||||||
print('Daemon started')
|
|
||||||
daemon.start()
|
|
||||||
elif 'stop' == sys.argv[1]:
|
|
||||||
print('Daemon stopped')
|
|
||||||
daemon.stop()
|
|
||||||
elif 'restart' == sys.argv[1]:
|
|
||||||
print('Daemon restarted')
|
|
||||||
daemon.restart()
|
|
||||||
else:
|
|
||||||
print("Unknown command")
|
|
||||||
sys.exit(2)
|
|
||||||
|
|
||||||
sys.exit(0)
|
|
||||||
else:
|
|
||||||
print
|
|
||||||
"usage: %s start|stop|restart" % sys.argv[0]
|
|
||||||
sys.exit(2)
|
|
Loading…
Reference in New Issue