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
d069c13e
authored
Mar 09, 2014
by
Bach Dániel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add agent-winservice.py
parent
054aa1ed
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
0 deletions
+32
-0
agent-winservice.py
+32
-0
No files found.
agent-winservice.py
0 → 100644
View file @
d069c13e
import
win32serviceutil
import
win32service
import
win32event
import
servicemanager
import
socket
from
agent
import
main
as
agent_main
,
reactor
class
AppServerSvc
(
win32serviceutil
.
ServiceFramework
):
_svc_name_
=
"circle-agent"
_svc_display_name_
=
"CIRCLE Agent"
def
__init__
(
self
,
args
):
win32serviceutil
.
ServiceFramework
.
__init__
(
self
,
args
)
self
.
hWaitStop
=
win32event
.
CreateEvent
(
None
,
0
,
0
,
None
)
socket
.
setdefaulttimeout
(
60
)
def
SvcStop
(
self
):
self
.
ReportServiceStatus
(
win32service
.
SERVICE_STOP_PENDING
)
win32event
.
SetEvent
(
self
.
hWaitStop
)
reactor
.
stop
()
def
SvcDoRun
(
self
):
servicemanager
.
LogMsg
(
servicemanager
.
EVENTLOG_INFORMATION_TYPE
,
servicemanager
.
PYS_SERVICE_STARTED
,
(
self
.
_svc_name_
,
''
))
agent_main
()
if
__name__
==
'__main__'
:
win32serviceutil
.
HandleCommandLine
(
AppServerSvc
)
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