Expose process titles in ps (not just python3!)

This commit is contained in:
Simon 2021-09-12 11:19:07 +01:00
parent 96e3739590
commit d8d5ddf555
3 changed files with 20 additions and 2 deletions

View File

@ -38,6 +38,7 @@ from time import time,sleep,perf_counter
import importlib.util import importlib.util
import re import re
import copy import copy
from setproctitle import setproctitle
# Twisted is pretty important, so I keep it separate # Twisted is pretty important, so I keep it separate
from twisted.internet.protocol import Factory, Protocol from twisted.internet.protocol import Factory, Protocol
@ -94,6 +95,11 @@ def config_reports(_config, _factory):
logger.debug('(REPORT) Periodic reporting loop started') logger.debug('(REPORT) Periodic reporting loop started')
_server.send_config() _server.send_config()
_server.send_bridge() _server.send_bridge()
i = 0
for system in CONFIG['SYSTEMS']:
if 'PEERS' in CONFIG['SYSTEMS'][system] and CONFIG['SYSTEMS'][system]['PEERS']:
i = i +1
logger.info('(REPORT) %s systems have at least one peer',i)
logger.info('(REPORT) HBlink TCP reporting server configured') logger.info('(REPORT) HBlink TCP reporting server configured')
@ -2129,6 +2135,9 @@ if __name__ == '__main__':
ID_MAX = 16776415 ID_MAX = 16776415
#Set process title early
setproctitle(__file__)
# Change the current directory to the location of the application # Change the current directory to the location of the application
os.chdir(os.path.dirname(os.path.realpath(sys.argv[0]))) os.chdir(os.path.dirname(os.path.realpath(sys.argv[0])))

View File

@ -5,11 +5,12 @@ from dmr_utils3.utils import int_id
import random import random
import ipaddress import ipaddress
import os import os
import setproctitle from proctitle
# Does anybody read this stuff? There's a PEP somewhere that says I should do this. # Does anybody read this stuff? There's a PEP somewhere that says I should do this.
__author__ = 'Simon Adlem - G7RZU' __author__ = 'Simon Adlem - G7RZU'
__copyright__ = 'Copyright (c) Simon Adlem, G7RZU 2020,2021' __copyright__ = 'Copyright (c) Simon Adlem, G7RZU 2020,2021'
__credits__ = 'Jon Lee, G4TSN; Norman Williams, M6NBP' __credits__ = 'Jon Lee, G4TSN; Norman Williams, M6NBP; Christian, OA4DOA'
__license__ = 'GNU GPLv3' __license__ = 'GNU GPLv3'
__maintainer__ = 'Simon Adlem G7RZU' __maintainer__ = 'Simon Adlem G7RZU'
__email__ = 'simon@gb7fr.org.uk' __email__ = 'simon@gb7fr.org.uk'
@ -184,6 +185,10 @@ if __name__ == '__main__':
#******************* #*******************
#Set process title early
setproctitle(__file__)
#If IPv6 is enabled by enivornment variable... #If IPv6 is enabled by enivornment variable...
if ListenIP == '' and 'FDPROXY_IPV6' in os.environ and bool(os.environ['FDPROXY_IPV6']): if ListenIP == '' and 'FDPROXY_IPV6' in os.environ and bool(os.environ['FDPROXY_IPV6']):
ListenIP = '::' ListenIP = '::'

View File

@ -25,6 +25,7 @@ from bitarray import bitarray
from time import time, sleep from time import time, sleep
from importlib import import_module from importlib import import_module
from random import randint from random import randint
from setproctitle import setproctitle
# Twisted is pretty important, so I keep it separate # Twisted is pretty important, so I keep it separate
from twisted.internet.protocol import Factory, Protocol from twisted.internet.protocol import Factory, Protocol
@ -172,6 +173,9 @@ if __name__ == '__main__':
import signal import signal
from dmr_utils3.utils import try_download, mk_id_dict from dmr_utils3.utils import try_download, mk_id_dict
#Set process title early
setproctitle(__file__)
# Change the current directory to the location of the application # Change the current directory to the location of the application
os.chdir(os.path.dirname(os.path.realpath(sys.argv[0]))) os.chdir(os.path.dirname(os.path.realpath(sys.argv[0])))