Compare commits
5 Commits
Author | SHA1 | Date |
---|---|---|
|
2dd678737b | |
|
165746a94b | |
|
3553aee8ce | |
|
b77b42ec22 | |
|
e20c671c1e |
12
CHANGELOG.md
12
CHANGELOG.md
|
@ -6,6 +6,18 @@ All notable changes to this project will be documented in this file.
|
||||||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
||||||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||||
|
|
||||||
|
## [5.8.0] - 2025-06-12
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
|
||||||
|
- Agents aren't being sent any signals on user logout. On the server side, assume that client disconnection == logout
|
||||||
|
|
||||||
|
## [5.7.1] - 2025-06-05
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
|
||||||
|
- Correcly handle UNIX signals in the user instance of the agent
|
||||||
|
|
||||||
## [5.7.0] - 2025-05-27
|
## [5.7.0] - 2025-05-27
|
||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
|
|
|
@ -1,3 +1,15 @@
|
||||||
|
ogagent (5.8.0-1) stable; urgency=medium
|
||||||
|
|
||||||
|
* When client disconnect, assume that the user logged out
|
||||||
|
|
||||||
|
-- OpenGnsys developers <info@opengnsys.es> Thu, 12 Jun 2025 15:30:50 +0200
|
||||||
|
|
||||||
|
ogagent (5.7.1-1) stable; urgency=medium
|
||||||
|
|
||||||
|
* Correctly handle UNIX signals
|
||||||
|
|
||||||
|
-- OpenGnsys developers <info@opengnsys.es> Thu, 05 Jun 2025 12:07:30 +0200
|
||||||
|
|
||||||
ogagent (5.7.0-1) stable; urgency=medium
|
ogagent (5.7.0-1) stable; urgency=medium
|
||||||
|
|
||||||
* Use TLS again
|
* Use TLS again
|
||||||
|
|
|
@ -35,6 +35,8 @@ import json
|
||||||
import sys
|
import sys
|
||||||
import time
|
import time
|
||||||
import os
|
import os
|
||||||
|
import socket
|
||||||
|
import signal
|
||||||
from PyQt6 import QtCore, QtGui, QtWidgets
|
from PyQt6 import QtCore, QtGui, QtWidgets
|
||||||
|
|
||||||
from about_dialog_ui import Ui_OGAAboutDialog
|
from about_dialog_ui import Ui_OGAAboutDialog
|
||||||
|
@ -328,6 +330,29 @@ if __name__ == '__main__':
|
||||||
trayIcon.quit()
|
trayIcon.quit()
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
|
## begin SIGTERM handling
|
||||||
|
signal_socket = socket.socketpair()
|
||||||
|
signal_socket[0].setblocking(False)
|
||||||
|
signal_socket[1].setblocking(False)
|
||||||
|
signal.set_wakeup_fd(signal_socket[0].fileno())
|
||||||
|
|
||||||
|
def signal_handler(signum, frame):
|
||||||
|
#print (f"Received signal {signum}")
|
||||||
|
pass
|
||||||
|
|
||||||
|
def qt_signal_handler():
|
||||||
|
data = signal_socket[1].recv(1)
|
||||||
|
#print(f"Signal ({data}) received via socket, shutting down gracefully...")
|
||||||
|
if trayIcon:
|
||||||
|
trayIcon.quit()
|
||||||
|
|
||||||
|
signal.signal(signal.SIGTERM, signal_handler)
|
||||||
|
signal.signal(signal.SIGINT, signal_handler)
|
||||||
|
|
||||||
|
notifier = QtCore.QSocketNotifier(signal_socket[1].fileno(), QtCore.QSocketNotifier.Type.Read)
|
||||||
|
notifier.activated.connect(qt_signal_handler)
|
||||||
|
## end SIGTERM handling
|
||||||
|
|
||||||
app.aboutToQuit.connect(trayIcon.cleanup)
|
app.aboutToQuit.connect(trayIcon.cleanup)
|
||||||
trayIcon.show()
|
trayIcon.show()
|
||||||
|
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
5.7.0
|
5.8.0
|
||||||
|
|
|
@ -167,7 +167,7 @@ class HTTPServerThread(threading.Thread):
|
||||||
logger.debug ('HTTP server: using certificate/CA from /opt/opengnsys/etc')
|
logger.debug ('HTTP server: using certificate/CA from /opt/opengnsys/etc')
|
||||||
context.load_cert_chain (certfile='/opt/opengnsys/etc/ogagent.crt', keyfile='/opt/opengnsys/etc/ogagent.key')
|
context.load_cert_chain (certfile='/opt/opengnsys/etc/ogagent.crt', keyfile='/opt/opengnsys/etc/ogagent.key')
|
||||||
context.load_verify_locations (cafile='/opt/opengnsys/etc/ca.crt')
|
context.load_verify_locations (cafile='/opt/opengnsys/etc/ca.crt')
|
||||||
elif os.path.exists (os.path.join (pf, 'ogagent.crt')) and os.path.exists (os.path.join (pf, 'ogagent.key')) and os.path.exists (os.path.join (pf, 'ca.crt')):
|
elif pf and os.path.exists (os.path.join (pf, 'ogagent.crt')) and os.path.exists (os.path.join (pf, 'ogagent.key')) and os.path.exists (os.path.join (pf, 'ca.crt')):
|
||||||
logger.debug (f'HTTP server: using certificate/CA from the installation path ({pf})')
|
logger.debug (f'HTTP server: using certificate/CA from the installation path ({pf})')
|
||||||
context.load_cert_chain (certfile=os.path.join (pf, 'ogagent.crt'), keyfile=os.path.join (pf, 'ogagent.key'))
|
context.load_cert_chain (certfile=os.path.join (pf, 'ogagent.crt'), keyfile=os.path.join (pf, 'ogagent.key'))
|
||||||
context.load_verify_locations (cafile=os.path.join (pf, 'ca.crt'))
|
context.load_verify_locations (cafile=os.path.join (pf, 'ca.crt'))
|
||||||
|
|
|
@ -30,6 +30,7 @@
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
import os
|
||||||
import json
|
import json
|
||||||
import queue
|
import queue
|
||||||
import socket
|
import socket
|
||||||
|
@ -193,6 +194,8 @@ class ClientProcessor(threading.Thread):
|
||||||
logger.error('Invalid message in queue: {}'.format(e))
|
logger.error('Invalid message in queue: {}'.format(e))
|
||||||
|
|
||||||
logger.debug('Client processor stopped')
|
logger.debug('Client processor stopped')
|
||||||
|
if os.path.exists ('/windows/temp'): open ('/windows/temp/ogagentuser_died', 'w').close()
|
||||||
|
else: open ( '/tmp/ogagentuser_died', 'w').close()
|
||||||
try:
|
try:
|
||||||
self.clientSocket.close()
|
self.clientSocket.close()
|
||||||
except Exception:
|
except Exception:
|
||||||
|
|
|
@ -30,6 +30,7 @@
|
||||||
@author: Adolfo Gómez, dkmaster at dkmon dot com
|
@author: Adolfo Gómez, dkmaster at dkmon dot com
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
import os
|
||||||
import json
|
import json
|
||||||
import socket
|
import socket
|
||||||
import time
|
import time
|
||||||
|
@ -197,6 +198,16 @@ class CommonService(object):
|
||||||
Invoked to wait a bit
|
Invoked to wait a bit
|
||||||
CAN be OVERRIDDEN
|
CAN be OVERRIDDEN
|
||||||
"""
|
"""
|
||||||
|
client_died=False
|
||||||
|
if os.path.exists ('/windows/temp/ogagentuser_died'):
|
||||||
|
os.unlink ('/windows/temp/ogagentuser_died')
|
||||||
|
client_died=True
|
||||||
|
elif os.path.exists ('/tmp/ogagentuser_died'):
|
||||||
|
os.unlink ('/tmp/ogagentuser_died')
|
||||||
|
client_died=True
|
||||||
|
if client_died:
|
||||||
|
self.notifyLogout (b'')
|
||||||
|
|
||||||
time.sleep(float(miliseconds) / 1000)
|
time.sleep(float(miliseconds) / 1000)
|
||||||
|
|
||||||
def notifyStop(self):
|
def notifyStop(self):
|
||||||
|
|
Loading…
Reference in New Issue