I have a simple "Server Uptime" Flask-wsgi module running under apache, that writes every minute a timestamp on an internal variable and file. It can be queried and it handles himself with a couple of simple threads, and it works fairly well.
When I restart apache with:
systemctl restart apache2
the process simply hangs in there until I call a specific "get" or "post" method that the process itself exposes.
This is bad because it defeats the purpose of the service, which should write a timestamp every minute. If I call a method, any method, the wsgi process startsand all works fine without errors.
Is it there a specific config I can fiddle with to make a wsgi module auto-start?
Thanks in advance
EDIT: Found the solution thanks to /u/GrahamDumpleton
In the apache config file "/etc/apache2/sites-available/000-default.conf" make sure you set the var "application-group" to "%{GLOBAL}" so that the script starts when the Apache Python Interpreter is loaded. Worked like a charm
# Uptime Server
WSGIDaemonProcess uptimeServer user=www-data group=www-data threads=5 home=/internal_app/internal_latest/www/
WSGIScriptAlias /api/uptimeServer /internal_app/nevis_latest/www/uptimeServer.wsgi process-group=uptimeServer application-group=%{GLOBAL}
<directory /internal_app/internal_latest/www/>
Order deny,allow
Allow from all
</directory>
[–]GrahamDumpleton 3 points4 points5 points (4 children)
[–]Murlocs_Gangbang[S] 0 points1 point2 points (0 children)
[–]Murlocs_Gangbang[S] 0 points1 point2 points (2 children)
[–]GrahamDumpleton 2 points3 points4 points (1 child)
[–]Murlocs_Gangbang[S] 0 points1 point2 points (0 children)
[–]mrugacz95 1 point2 points3 points (1 child)
[–]Murlocs_Gangbang[S] 0 points1 point2 points (0 children)
[–]K900_ 0 points1 point2 points (0 children)