Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
CIRCLE
/
agent
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
7
Merge Requests
0
Wiki
Members
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
A prog2-höz tartozó friss repo anyagok itt elérhetőek:
https://git.iit.bme.hu/
Commit
8879b198
authored
Sep 24, 2014
by
Guba Sándor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add watchdog service
parent
cc0b9eb8
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
0 deletions
+3
-0
watchdog-winservice.py
+3
-0
No files found.
watchdog-winservice.py
View file @
8879b198
...
@@ -23,6 +23,7 @@ logger.info("%s loaded", __file__)
...
@@ -23,6 +23,7 @@ logger.info("%s loaded", __file__)
service_name
=
"circle-agent"
service_name
=
"circle-agent"
stopped
=
False
stopped
=
False
def
watch
():
def
watch
():
def
check_service
(
service_name
):
def
check_service
(
service_name
):
return
win32serviceutil
.
QueryServiceStatus
(
service_name
)[
1
]
==
4
return
win32serviceutil
.
QueryServiceStatus
(
service_name
)[
1
]
==
4
...
@@ -38,6 +39,7 @@ def watch():
...
@@ -38,6 +39,7 @@ def watch():
return
return
sleep
(
10
)
sleep
(
10
)
class
AppServerSvc
(
win32serviceutil
.
ServiceFramework
):
class
AppServerSvc
(
win32serviceutil
.
ServiceFramework
):
_svc_name_
=
"circle-watchdog"
_svc_name_
=
"circle-watchdog"
_svc_display_name_
=
"CIRCLE Watchdog"
_svc_display_name_
=
"CIRCLE Watchdog"
...
@@ -50,6 +52,7 @@ class AppServerSvc (win32serviceutil.ServiceFramework):
...
@@ -50,6 +52,7 @@ class AppServerSvc (win32serviceutil.ServiceFramework):
def
SvcStop
(
self
):
def
SvcStop
(
self
):
self
.
ReportServiceStatus
(
win32service
.
SERVICE_STOP_PENDING
)
self
.
ReportServiceStatus
(
win32service
.
SERVICE_STOP_PENDING
)
win32event
.
SetEvent
(
self
.
hWaitStop
)
win32event
.
SetEvent
(
self
.
hWaitStop
)
global
stopped
stopped
=
True
stopped
=
True
logger
.
info
(
"
%
s stopped"
,
__file__
)
logger
.
info
(
"
%
s stopped"
,
__file__
)
...
...
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